Skip to content

Commit 91bcac9

Browse files
committed
Fix build against musl
1 parent bcdd4b9 commit 91bcac9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Diff for: src/System.CommandLine.Suggest.Tests/dotnet-suggest.Tests.csproj

+13
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@
3838

3939
<Target Name="DotnetSuggestIntegrationTestAssets" BeforeTargets="Build" Condition="'$(Configuration)' == 'Release'">
4040

41+
<Exec IgnoreExitCode="true" Command="ldd --version 2&gt;&amp;1 | grep -q musl">
42+
<Output TaskParameter="ExitCode" PropertyName="OSPlatformIsMuslCheck" />
43+
</Exec>
44+
45+
<PropertyGroup>
46+
<OSPlatformIsMusl Condition="$(OSPlatformIsMuslCheck) == '0'">true</OSPlatformIsMusl>
47+
<OSPlatformIsMusl Condition="$(OSPlatformIsMusl) == ''">false</OSPlatformIsMusl>
48+
</PropertyGroup>
49+
4150
<PropertyGroup>
4251
<TestAssetsPath>
4352
$([System.IO.Path]::GetFullPath('$(OutputPath)'))/TestAssets
@@ -56,6 +65,10 @@
5665
<Rid>linux-x64</Rid>
5766
</PropertyGroup>
5867

68+
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true' AND '$(OSPlatformIsMusl)' == 'true'">
69+
<Rid>linux-musl-x64</Rid>
70+
</PropertyGroup>
71+
5972
<MSBuild BuildInParallel="False" Projects="../System.CommandLine.Suggest/dotnet-suggest.csproj" Targets="Restore" Properties="UseAppHost=true;SelfContained=false;RuntimeIdentifier=$(Rid);ForceRestoreToEvaluateSeparately=1;Configuration=Release">
6073
</MSBuild>
6174

Diff for: src/System.CommandLine.Suggest/dotnet-suggest.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<PackAsTool>true</PackAsTool>
77
<PackageId>dotnet-suggest</PackageId>
88
<ToolCommandName>dotnet-suggest</ToolCommandName>
9-
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86;osx-x64;linux-x64</PackAsToolShimRuntimeIdentifiers>
9+
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86;osx-x64;linux-x64;linux-musl-x64</PackAsToolShimRuntimeIdentifiers>
1010
<PackagedShimOutputRootDirectory>$(OutputPath)</PackagedShimOutputRootDirectory>
1111

1212
<DotnetSuggestBuildNumber>.1</DotnetSuggestBuildNumber>

0 commit comments

Comments
 (0)