Fixed: Set musl status at compile time

[common]
This commit is contained in:
ta264
2021-01-21 21:16:33 +00:00
committed by Qstick
parent 853a15087d
commit 00c2211d45
2 changed files with 6 additions and 7 deletions

View File

@@ -97,16 +97,14 @@ namespace NzbDrone.Common.EnvironmentInfo
}
else
{
return IsMusl() ? Os.LinuxMusl : Os.Linux;
#if ISMUSL
return Os.LinuxMusl;
#else
return Os.Linux;
#endif
}
}
private static bool IsMusl()
{
var output = RunAndCapture("ldd", "/bin/ls");
return output.Contains("libc.musl");
}
private static string RunAndCapture(string filename, string args)
{
var processStartInfo = new ProcessStartInfo

View File

@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;net472</TargetFrameworks>
<DefineConstants Condition="'$(RuntimeIdentifier)' == 'linux-musl-x64' or '$(RuntimeIdentifier)' == 'linux-musl-arm64'">ISMUSL</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNet4.SocksProxy" Version="1.4.0.1" />