-
Notifications
You must be signed in to change notification settings - Fork 379
Open
Description
Problem
In archives.targets, the tar commands for creating .tar.gz archives have IgnoreExitCode="true" and IgnoreStandardErrorWarningFormat="true":
<Exec Command="tar -czf "$(_DestinationFileName)" ."
IgnoreExitCode="true"
IgnoreStandardErrorWarningFormat="true"
WorkingDirectory="$(_OutputPathRoot)"
Condition="'$(_CurrentArchiveFormat)' == 'tar.gz' and '$(_PigzFoundExitCode)' != '0'"/>This causes tar failures to be silently ignored.
Impact
- Failed archive creation goes unnoticed
- Missing archives aren't caught until downstream consumers fail
- Difficult to diagnose because the build appears successful
Proposed Solution
- Remove IgnoreExitCode="true" and IgnoreStandardErrorWarningFormat="true" from the tar commands
- Let tar failures fail the build so issues are caught immediately
- If there are legitimate cases where tar errors should be ignored, those should be handled explicitly rather than blanket-ignoring all errors
Affected Code
- src/arcade/src/Microsoft.DotNet.Build.Tasks.Archives/build/archives.targets- This applies to both the normal archive creation logic as well as the symbol archives
Questions to Investigate
- Why were these flags added originally? Is there a scenario where tar "failing" is expected/acceptable?
- Are there cases where tar outputs warnings to stderr that shouldn't fail the build?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels