Skip to content

Commit

Permalink
Fix build against musl
Browse files Browse the repository at this point in the history
  • Loading branch information
ayakael committed Mar 15, 2022
1 parent bcdd4b9 commit 91bcac9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/System.CommandLine.Suggest.Tests/dotnet-suggest.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@

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

<Exec IgnoreExitCode="true" Command="ldd --version 2&gt;&amp;1 | grep -q musl">
<Output TaskParameter="ExitCode" PropertyName="OSPlatformIsMuslCheck" />
</Exec>

<PropertyGroup>
<OSPlatformIsMusl Condition="$(OSPlatformIsMuslCheck) == '0'">true</OSPlatformIsMusl>
<OSPlatformIsMusl Condition="$(OSPlatformIsMusl) == ''">false</OSPlatformIsMusl>
</PropertyGroup>

<PropertyGroup>
<TestAssetsPath>
$([System.IO.Path]::GetFullPath('$(OutputPath)'))/TestAssets
Expand All @@ -56,6 +65,10 @@
<Rid>linux-x64</Rid>
</PropertyGroup>

<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true' AND '$(OSPlatformIsMusl)' == 'true'">
<Rid>linux-musl-x64</Rid>
</PropertyGroup>

<MSBuild BuildInParallel="False" Projects="../System.CommandLine.Suggest/dotnet-suggest.csproj" Targets="Restore" Properties="UseAppHost=true;SelfContained=false;RuntimeIdentifier=$(Rid);ForceRestoreToEvaluateSeparately=1;Configuration=Release">
</MSBuild>

Expand Down
2 changes: 1 addition & 1 deletion src/System.CommandLine.Suggest/dotnet-suggest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<PackAsTool>true</PackAsTool>
<PackageId>dotnet-suggest</PackageId>
<ToolCommandName>dotnet-suggest</ToolCommandName>
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86;osx-x64;linux-x64</PackAsToolShimRuntimeIdentifiers>
<PackAsToolShimRuntimeIdentifiers>win-x64;win-x86;osx-x64;linux-x64;linux-musl-x64</PackAsToolShimRuntimeIdentifiers>
<PackagedShimOutputRootDirectory>$(OutputPath)</PackagedShimOutputRootDirectory>

<DotnetSuggestBuildNumber>.1</DotnetSuggestBuildNumber>
Expand Down

0 comments on commit 91bcac9

Please sign in to comment.