Skip to content

Commit 7d0230f

Browse files
committed
fix: support musl on Linux
1 parent f21135e commit 7d0230f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

scripts/build-sentry-native.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ try
2929
}
3030
elseif ($IsLinux)
3131
{
32-
$outDir += '/linux-x64'
32+
if ((ldd --version 2>&1) -match 'musl')
33+
{
34+
$outDir += '/linux-musl-x64'
35+
}
36+
else
37+
{
38+
$outDir += '/linux-x64'
39+
}
3340
}
3441
else
3542
{

src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
<NativeLibrary Include="Gdi32.lib" />
3434
</ItemGroup>
3535

36-
<ItemGroup Condition="'$(FrameworkSupportsNative)' == 'true' and '$(RuntimeIdentifier)' == 'linux-x64'">
36+
<ItemGroup Condition="'$(FrameworkSupportsNative)' == 'true' and ('$(RuntimeIdentifier)' == 'linux-x64' or '$(RuntimeIdentifier)' == 'linux-musl-x64')">
3737
<DirectPInvoke Include="sentry-native" />
38-
<NativeLibrary Include="$(MSBuildThisFileDirectory)..\sentry-native\linux-x64\libsentry-native.a" />
38+
<NativeLibrary Include="$(MSBuildThisFileDirectory)..\sentry-native\$(RuntimeIdentifier)\libsentry-native.a" />
3939
<!-- See: https://github.com/dotnet/runtime/issues/97414 -->
4040
<NativeSystemLibrary Include="curl" />
4141
</ItemGroup>

0 commit comments

Comments
 (0)