Skip to content

[BUG]: PublishPipelineArtifact does not preserve symlinks #21524

@Kolos65

Description

@Kolos65

Task name

PublishPipelineArtifact

Task version

v1

Issue Description

As noted by many in #11980 (which was closed for unclear reasons), there is a bug in how PublishPipelineArtifact handles symbolic links.

PublishPipelineArtifact will try to resolve all symlinks and create a copy of the original linked file in the published artifact bundle. This is problematic for many reasons:

  • By resolving symlinks, it will duplicate possibly very large artifacts for seemingly no real benefit
  • Any broken symlink will break the task execution with a fatal error:
Failed to calculate hash for the file's reparse point: /path/to/symlink
Failed to hash a page of files. Exception listed below...
System.IO.FileLoadException: Unable to load symbolic/hard linked file.  Check 'fsutil behavior query SymlinkEvaluation' to ensure proper behavior.
 ---> System.IO.FileNotFoundException: Could not find file '/path/to/symlink'.

This issue is very common in Apple development environments where symbolic links are used frequently and build artifacts can more often than not contain broken ones as well.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Operation system

macos-15

Relevant log output

Failed to calculate hash for the file's reparse point: /path/to/symlink
Failed to hash a page of files. Exception listed below...
System.IO.FileLoadException: Unable to load symbolic/hard linked file.  Check 'fsutil behavior query SymlinkEvaluation' to ensure proper behavior.
 ---> System.IO.FileNotFoundException: Could not find file '/path/to/symlink'.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions