Skip to content

fix: support musl on Linux #4188

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
May 22, 2025
Merged

fix: support musl on Linux #4188

merged 3 commits into from
May 22, 2025

Conversation

jpnurmi
Copy link
Collaborator

@jpnurmi jpnurmi commented May 14, 2025

This PR adds native AOT support for linux-musl-x64:

Sentry.5.8.0.nupkg
└── sentry-native
    ├── linux-musl-x64
    │   └── libsentry-native.a # <== NEW
    ├── linux-x64
    │   └── libsentry-native.a
    ├── osx
    │   └── libsentry-native.a
    ├── win-arm64
    │   └── sentry-native.lib
    └── win-x64
        └── sentry-native.lib

TODO:

Notes:

  • setup-dotnet is musl-compatible 👍
  • setup-java installs musl-incompatible binaries 👎
  • setup-android installs musl-incompatible prebuilt (Android SDK Build-Tools) binaries 👎

Close: #4127

@jpnurmi jpnurmi force-pushed the fix/musl branch 6 times, most recently from eee505e to 333332c Compare May 15, 2025 19:52
@jpnurmi
Copy link
Collaborator Author

jpnurmi commented May 16, 2025

Hi @jamescrosswell, I finally managed to get linux-musl-x64 to pass the whole CI pipeline, including integration tests. :) The last remaining TODO-item is to make the Docker image available:

Is the approach with Sentry-CI-Build-Linux-musl.slnf sensible? I wish we could use NO_MOBILE=true or NO_ANDROID=true with the existing Sentry-CI-Build-Linux.slnf, but it pulls in several projects that fail to build without Android SDK:

  • Sentry.Bindings.Android
  • Sentry.Samples.Android
  • Sentry.Samples.Maui
  • AndroidTestApp (Sentry.Android.AssemblyReader.Tests)

@jpnurmi jpnurmi changed the title WIP: fix: support musl on Linux fix: support musl on Linux May 17, 2025
@bruno-garcia
Copy link
Member

Is the approach with Sentry-CI-Build-Linux-musl.slnf sensible? I wish we could use NO_MOBILE=true or NO_ANDROID=true with the existing Sentry-CI-Build-Linux.slnf, but it pulls in several projects that fail to build without Android SDK:

I'd say so, and I copied your approach on #4187 (which won't land anytime soon since it's blocked on sentry-native win-arm64 support but at least will be ready once that lands

@jamescrosswell
Copy link
Collaborator

jamescrosswell commented May 19, 2025

Is the approach with Sentry-CI-Build-Linux-musl.slnf sensible? I wish we could use NO_MOBILE=true or NO_ANDROID=true with the existing Sentry-CI-Build-Linux.slnf, but it pulls in several projects that fail to build without Android SDK:

Yeah I think that makes sense. The names we give to these solutions are maybe what's confusing. Implicitly building musl we're trying to provide better support for SDK users deploying ASP.NET Core apps using docker containers... so no android required.

However Sentry-CI-Build-Linux.slnf is just the base solution for contributors to the Sentry SDK who are running Linux and they could well be building Android apps... so we can't really rip it out of there.

@jpnurmi jpnurmi force-pushed the fix/musl branch 2 times, most recently from 5eb47e5 to 9971b68 Compare May 19, 2025 10:11
@jamescrosswell
Copy link
Collaborator

I'm not sure if it's caused you any issues here but just FYI:

@jpnurmi jpnurmi marked this pull request as ready for review May 22, 2025 07:58
@bruno-garcia bruno-garcia merged commit 6845e75 into main May 22, 2025
34 checks passed
@bruno-garcia bruno-garcia deleted the fix/musl branch May 22, 2025 15:28
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors with sentry-native launching with Sentry.AspNetCore on Dockerized Native AOT builds on Linux
4 participants