archives.targets: Fix creating tar.gz on Windows
Creating .tar.gz arhives on windows from _CreateArchive target
fails silently with:
tar: could not chdir to ''C:\Users\ankj\source\repos\aspire\artifacts\obj\Aspire.Cli.linux-arm64\Debug\net8.0\output/''
Fixing the mismatched directory separators does not help, neither does
removing the trailing /'. Instead this whole thing can be side-stepped
by using WorkingDirectory parameter of the Exec task.
Also:
- fixes the path used in generation of the symbols tarball
- Construct the various paths using msbuild's
NormalizePath, andNormalizeDirectoryfunctions so they get the correct directory separators.
cc @joperezr @danmoseley
An instance of the failure is in https://dev.azure.com/dnceng/internal/_build/results?buildId=2733005&view=logs&j=0bc77094-9fcd-5c38-f6e4-27d2ae131589&t=5138e247-88cb-5ba0-8eee-e2fdd127e7e8 .
/backport to release/9.0
Started backporting to release/9.0: https://github.com/dotnet/arcade/actions/runs/15856525371
@radical backporting to "release/9.0" failed, the patch most likely resulted in conflicts:
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: archives.targets: Fix creating tar.gz on Windows
Using index info to reconstruct a base tree...
M src/Microsoft.DotNet.Build.Tasks.Archives/build/archives.targets
Falling back to patching base and 3-way merge...
Auto-merging src/Microsoft.DotNet.Build.Tasks.Archives/build/archives.targets
CONFLICT (content): Merge conflict in src/Microsoft.DotNet.Build.Tasks.Archives/build/archives.targets
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 archives.targets: Fix creating tar.gz on Windows
Error: The process '/usr/bin/git' failed with exit code 128
Please backport manually!