Skip to content

Commit d70c77b

Browse files
committed
Fix tar command location
1 parent c024de5 commit d70c77b

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ This package is an internal implementation of the .NET Core SDK and is not meant
154154
<CreateDirectory Include="$(LocalInstallationOutputPath)" />
155155
</ItemGroup>
156156

157+
<PropertyGroup>
158+
<TarCommand Condition="'$(OS)' == 'Windows_NT'">C:\Windows\System32\tar</TarCommand>
159+
<TarCommand Condition="'$(OS)' != 'Windows_NT'">tar</TarCommand>
160+
</PropertyGroup>
161+
157162
<!-- Workaround https://github.com/dotnet/sdk/issues/2910 by copying targeting pack into local installation. -->
158163
<Target Name="_InstallTargetingPackIntoLocalDotNet"
159164
DependsOnTargets="_ResolveTargetingPackContent"
@@ -175,7 +180,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
175180
Overwrite="true" />
176181
<!-- Requires Windows 10 version 1803 or newer -->
177182
<Exec
178-
Command="C:\Windows\System32\tar -czf $(TarArchiveOutputPath) ."
183+
Command="$(TarCommand) -czf $(TarArchiveOutputPath) ."
179184
WorkingDirectory="$(TargetingPackLayoutRoot)" />
180185
<Message Importance="High" Text="$(MSBuildProjectName) -> $(TarArchiveOutputPath)" />
181186
</Target>

src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,12 @@ This package is an internal implementation of the .NET Core SDK and is not meant
363363
Targets related to creating .zip/.tar.gz
364364
#########################################
365365
-->
366+
367+
<PropertyGroup>
368+
<TarCommand Condition="'$(OS)' == 'Windows_NT'">C:\Windows\System32\tar</TarCommand>
369+
<TarCommand Condition="'$(OS)' != 'Windows_NT'">tar</TarCommand>
370+
</PropertyGroup>
371+
366372
<Target Name="_DownloadAndExtractDotNetRuntime" Condition="'$(DotNetBuildFromSource)' != 'true'">
367373
<DownloadFile Condition=" ! Exists('$(DotNetRuntimeArchive)')"
368374
SourceUrl="$(DotNetRuntimeDownloadUrl)$(DotNetAssetRootAccessTokenSuffix)"
@@ -371,7 +377,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
371377

372378
<!-- Extract the dotnet-runtime archive -->
373379
<Exec Condition="'$(ArchiveExtension)' == '.tar.gz'"
374-
Command="C:\Windows\System32\tar -xzf $(DotNetRuntimeArchive) -C $(RedistSharedFrameworkLayoutRoot)" />
380+
Command="$(TarCommand) -xzf $(DotNetRuntimeArchive) -C $(RedistSharedFrameworkLayoutRoot)" />
375381

376382
<Unzip Condition="'$(ArchiveExtension)' == '.zip'"
377383
SourceFiles="$(DotNetRuntimeArchive)"
@@ -436,7 +442,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
436442
Overwrite="true"
437443
Condition="'$(ArchiveExtension)' == '.zip'" />
438444
<Exec
439-
Command="C:\Windows\System32\tar -czf $(InternalArchiveOutputPath) ."
445+
Command="$(TarCommand) -czf $(InternalArchiveOutputPath) ."
440446
WorkingDirectory="$(SharedFrameworkLayoutRoot)"
441447
Condition="'$(ArchiveExtension)' == '.tar.gz'" />
442448
</Target>
@@ -453,7 +459,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
453459
Overwrite="true"
454460
Condition="'$(ArchiveExtension)' == '.zip'" />
455461
<Exec
456-
Command="C:\Windows\System32\tar -czf $(RedistArchiveOutputPath) ."
462+
Command="$(TarCommand) -czf $(RedistArchiveOutputPath) ."
457463
WorkingDirectory="$(RedistSharedFrameworkLayoutRoot)"
458464
Condition="'$(ArchiveExtension)' == '.tar.gz'" />
459465
</Target>

0 commit comments

Comments
 (0)