Skip to content

Conversation

@radical
Copy link
Member

@radical radical commented Jun 18, 2025

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, and
    NormalizeDirectory functions so they get the correct directory
    separators.

cc @joperezr @danmoseley

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`, and
  `NormalizeDirectory` functions so they get the correct directory
  separators.
@radical
Copy link
Member Author

radical commented Jun 18, 2025

@ViktorHofer ViktorHofer merged commit debf971 into dotnet:main Jun 23, 2025
11 checks passed
@radical

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

radical added a commit to radical/arcade that referenced this pull request Jun 24, 2025
Backport dotnet#15913

```
commit debf971
Author: Ankit Jain <radical@gmail.com>
Date:   Mon Jun 23 13:08:03 2025 -0400

    archives.targets: Fix creating tar.gz on Windows (dotnet#15913)
```
@radical radical deleted the fix-tar-gz-archives branch June 24, 2025 17:15
<Exec Command="tar -cf - . | pigz &gt; '$(_DestinationFileName)'"
IgnoreExitCode="true"
IgnoreStandardErrorWarningFormat="true"
WorkingDirectory="$(_SymbolsOutputPathRoot)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this actually fixed a wrong change from 101a54b which used $(_OutputPathRoot) instead of $(_SymbolsOutputPathRoot) here.

I'm a bit surprised we haven't seen any breakages due to this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants