Skip to content

Commit 697c47d

Browse files
committed
Fix build against musl
1 parent bcdd4b9 commit 697c47d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/System.CommandLine.Suggest.Tests/dotnet-suggest.Tests.csproj

Lines changed: 13 additions & 0 deletions
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

src/System.CommandLine.Suggest/dotnet-suggest.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<PackageId>dotnet-suggest</PackageId>
88
<ToolCommandName>dotnet-suggest</ToolCommandName>
99
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86;osx-x64;linux-x64</PackAsToolShimRuntimeIdentifiers>
10+
<PackAsToolShimRuntimeIdentifiers Condition="'$(OSPlatformIsMusl)' == 'true'">linux-musl-x64</PackAsToolShimRuntimeIdentifiers>
1011
<PackagedShimOutputRootDirectory>$(OutputPath)</PackagedShimOutputRootDirectory>
1112

1213
<DotnetSuggestBuildNumber>.1</DotnetSuggestBuildNumber>

0 commit comments

Comments
 (0)