diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml
index fb702d245a..1b77f74dd1 100644
--- a/.github/actions/environment/action.yml
+++ b/.github/actions/environment/action.yml
@@ -19,11 +19,13 @@ runs:
# Needed for Android SDK setup step
- uses: actions/setup-java@v3
+ if: ${{ !matrix.container }}
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Android SDK
+ if: ${{ !matrix.container }}
uses: android-actions/setup-android@07976c6290703d34c16d382cb36445f98bb43b1f # v3.2.0
with:
log-accepted-android-sdk-licenses: false
@@ -41,6 +43,7 @@ runs:
cd -
- name: Set Java Version
+ if: ${{ !matrix.container }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
diff --git a/.github/actions/freediskspace/action.yml b/.github/actions/freediskspace/action.yml
index 584430d227..5c097f7da8 100644
--- a/.github/actions/freediskspace/action.yml
+++ b/.github/actions/freediskspace/action.yml
@@ -23,7 +23,7 @@ runs:
if: runner.os == 'Linux'
shell: bash
run: |
- df -h /dev/root
+ df -h / # df: /dev/root: can't find mount point
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/local/julia1.10.5
sudo rm -rf /usr/lib/heroku
@@ -32,4 +32,4 @@ runs:
sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..."
sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..."
- df -h /dev/root
+ df -h / # df: /dev/root: can't find mount point
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8f1970c21f..6b66156967 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,14 +11,20 @@ on:
jobs:
build-sentry-native:
- name: sentry-native (${{ matrix.os }})
+ name: sentry-native (${{ matrix.container || matrix.os }})
runs-on: ${{ matrix.os }}
+ container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
- # Pin ubuntu to ensure mono is installed
- # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
- os: [ubuntu-22.04, windows-latest, macos-15]
+ include:
+ - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed
+ target: Linux
+ - os: ubuntu-latest
+ container: ghcr.io/jpnurmi/alpine:3.19 # TODO: getsentry
+ target: Linux-musl
+ - os: windows-latest
+ - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
steps:
- name: Checkout
@@ -30,14 +36,14 @@ jobs:
id: cache
with:
path: src/Sentry/Platforms/Native/sentry-native
- key: sentry-native-${{ runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
+ key: sentry-native-${{ matrix.target || runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
enableCrossOsArchive: true
- name: Remove unused applications
uses: ./.github/actions/freediskspace
- name: Install build dependencies
- if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Linux'
+ if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Linux' && !matrix.container
run: |
sudo apt update
sudo apt install libcurl4-openssl-dev
@@ -48,15 +54,21 @@ jobs:
build:
needs: build-sentry-native
- name: .NET (${{ matrix.os }})
+ name: .NET (${{ matrix.container || matrix.os }})
runs-on: ${{ matrix.os }}
+ container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
- # Pin ubuntu to ensure mono is installed
- # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
- os: [ubuntu-22.04, windows-latest, macos-15]
+ include:
+ - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed
+ target: Linux
+ - os: ubuntu-latest
+ container: ghcr.io/jpnurmi/alpine:3.21 # TODO: getsentry
+ target: Linux-musl
+ - os: windows-latest
+ - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
steps:
- name: Cancel Previous Runs
@@ -78,13 +90,21 @@ jobs:
run: echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV
- name: Download sentry-native (Linux)
- if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Linux') }}
+ if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.target == 'Linux') }}
uses: actions/cache/restore@v4
with:
path: src/Sentry/Platforms/Native/sentry-native
key: sentry-native-Linux-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
fail-on-cache-miss: true
+ - name: Download sentry-native (Linux musl)
+ if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.target == 'Linux-musl') }}
+ uses: actions/cache/restore@v4
+ with:
+ path: src/Sentry/Platforms/Native/sentry-native
+ key: sentry-native-Linux-musl-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
+ fail-on-cache-miss: true
+
- name: Download sentry-native (macOS)
if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'macOS') }}
uses: actions/cache/restore@v4
@@ -106,24 +126,25 @@ jobs:
uses: ./.github/actions/environment
- name: Build Native Dependencies
+ if: ${{ !matrix.container }}
uses: ./.github/actions/buildnative
- name: Restore .NET Dependencies
- run: dotnet restore Sentry-CI-Build-${{ runner.os }}.slnf --nologo
+ run: dotnet restore Sentry-CI-Build-${{ matrix.target || runner.os }}.slnf --nologo
- name: Build
id: build
- run: dotnet build Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-restore --nologo -v:minimal -flp:logfile=build.log -p:CopyLocalLockFileAssemblies=true -bl:build.binlog
+ run: dotnet build Sentry-CI-Build-${{ matrix.target || runner.os }}.slnf -c Release --no-restore --nologo -v:minimal -flp:logfile=build.log -p:CopyLocalLockFileAssemblies=true -bl:build.binlog
- name: Upload build logs
if: ${{ steps.build.outcome != 'skipped' }}
uses: actions/upload-artifact@v4
with:
- name: ${{ runner.os }}-build-logs
+ name: ${{ matrix.target || runner.os }}-build-logs
path: build.binlog
- name: Test
- run: dotnet test Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}" --collect "XPlat Code Coverage"
+ run: dotnet test Sentry-CI-Build-${{ matrix.target || runner.os }}.slnf -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}" --collect "XPlat Code Coverage"
- name: Upload code coverage
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d
@@ -132,14 +153,14 @@ jobs:
if: failure()
uses: actions/upload-artifact@v4
with:
- name: ${{ runner.os }}-verify-test-results
+ name: ${{ matrix.target || runner.os }}-verify-test-results
path: "**/*.received.*"
# To save time and disk space, we only create and archive the Nuget packages when we're actually releasing.
- name: Create Nuget Packages
if: env.CI_PUBLISHING_BUILD == 'true'
- run: dotnet pack Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-build --nologo
+ run: dotnet pack Sentry-CI-Build-${{ matrix.target || runner.os }}.slnf -c Release --no-build --nologo
- name: Archive Nuget Packages
if: env.CI_PUBLISHING_BUILD == 'true'
@@ -153,15 +174,20 @@ jobs:
integration-test:
needs: build
- name: Integration test (${{ matrix.os }})
+ name: Integration test (${{ matrix.container || matrix.os }})
runs-on: ${{ matrix.os }}
+ container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
- # Pin ubuntu to ensure mono is installed
- # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
- os: [ubuntu-22.04, windows-latest, macos-15]
+ include:
+ - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed
+ - os: ubuntu-latest
+ container: ghcr.io/jpnurmi/alpine:3.21 # TODO: getsentry
+ target: Linux-musl
+ - os: windows-latest
+ - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
steps:
- uses: actions/checkout@v4
@@ -180,7 +206,7 @@ jobs:
path: src
- name: Install build dependencies
- if: runner.os == 'Linux'
+ if: runner.os == 'Linux' && !matrix.container
run: |
sudo apt update
sudo apt install libcurl4-openssl-dev
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 156cc1d0c4..6df50b1b47 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@
- Redact Authorization headers before sending events to Sentry ([#4164](https://github.com/getsentry/sentry-dotnet/pull/4164))
- Remove Strong Naming from Sentry.Hangfire ([#4099](https://github.com/getsentry/sentry-dotnet/pull/4099))
- Increase `RequestSize.Small` threshold from 1 kB to 4 kB to match other SDKs ([#4177](https://github.com/getsentry/sentry-dotnet/pull/4177))
+- Support musl on Linux ([#4182](https://github.com/getsentry/sentry-dotnet/pull/4182))
### Features
diff --git a/Sentry-CI-Build-Linux-musl.slnf b/Sentry-CI-Build-Linux-musl.slnf
new file mode 100644
index 0000000000..c49e749063
--- /dev/null
+++ b/Sentry-CI-Build-Linux-musl.slnf
@@ -0,0 +1,74 @@
+{
+ "solution": {
+ "path": ".generated.NoMobile.sln",
+ "projects": [
+ "benchmarks\\Sentry.Benchmarks\\Sentry.Benchmarks.csproj",
+ "samples\\Sentry.Samples.AspNetCore.Basic\\Sentry.Samples.AspNetCore.Basic.csproj",
+ "samples\\Sentry.Samples.AspNetCore.Blazor.Server\\Sentry.Samples.AspNetCore.Blazor.Server.csproj",
+ "samples\\Sentry.Samples.AspNetCore.Blazor.Wasm\\Sentry.Samples.AspNetCore.Blazor.Wasm.csproj",
+ "samples\\Sentry.Samples.AspNetCore.Grpc\\Sentry.Samples.AspNetCore.Grpc.csproj",
+ "samples\\Sentry.Samples.AspNetCore.Mvc\\Sentry.Samples.AspNetCore.Mvc.csproj",
+ "samples\\Sentry.Samples.AspNetCore.Serilog\\Sentry.Samples.AspNetCore.Serilog.csproj",
+ "samples\\Sentry.Samples.AspNetCore.WebAPI.Profiling\\Sentry.Samples.AspNetCore.WebAPI.Profiling.csproj",
+ "samples\\Sentry.Samples.Aws.Lambda.AspNetCoreServer\\Sentry.Samples.Aws.Lambda.AspNetCoreServer.csproj",
+ "samples\\Sentry.Samples.Azure.Functions.Worker\\Sentry.Samples.Azure.Functions.Worker.csproj",
+ "samples\\Sentry.Samples.Console.Basic\\Sentry.Samples.Console.Basic.csproj",
+ "samples\\Sentry.Samples.Console.Customized\\Sentry.Samples.Console.Customized.csproj",
+ "samples\\Sentry.Samples.Console.HeapDump\\Sentry.Samples.Console.HeapDump.csproj",
+ "samples\\Sentry.Samples.Console.Native\\Sentry.Samples.Console.Native.csproj",
+ "samples\\Sentry.Samples.Console.Profiling\\Sentry.Samples.Console.Profiling.csproj",
+ "samples\\Sentry.Samples.EntityFramework\\Sentry.Samples.EntityFramework.csproj",
+ "samples\\Sentry.Samples.GenericHost\\Sentry.Samples.GenericHost.csproj",
+ "samples\\Sentry.Samples.Google.Cloud.Functions\\Sentry.Samples.Google.Cloud.Functions.csproj",
+ "samples\\Sentry.Samples.GraphQL.Client.Http\\Sentry.Samples.GraphQL.Client.Http.csproj",
+ "samples\\Sentry.Samples.GraphQL.Server\\Sentry.Samples.GraphQL.Server.csproj",
+ "samples\\Sentry.Samples.Hangfire\\Sentry.Samples.Hangfire.csproj",
+ "samples\\Sentry.Samples.Log4Net\\Sentry.Samples.Log4Net.csproj",
+ "samples\\Sentry.Samples.ME.Logging\\Sentry.Samples.ME.Logging.csproj",
+ "samples\\Sentry.Samples.NLog\\Sentry.Samples.NLog.csproj",
+ "samples\\Sentry.Samples.OpenTelemetry.AspNetCore\\Sentry.Samples.OpenTelemetry.AspNetCore.csproj",
+ "samples\\Sentry.Samples.OpenTelemetry.Console\\Sentry.Samples.OpenTelemetry.Console.csproj",
+ "samples\\Sentry.Samples.Serilog\\Sentry.Samples.Serilog.csproj",
+ "src\\Sentry.Analyzers\\Sentry.Analyzers.csproj",
+ "src\\Sentry.AspNet\\Sentry.AspNet.csproj",
+ "src\\Sentry.AspNetCore.Blazor.WebAssembly\\Sentry.AspNetCore.Blazor.WebAssembly.csproj",
+ "src\\Sentry.AspNetCore.Grpc\\Sentry.AspNetCore.Grpc.csproj",
+ "src\\Sentry.AspNetCore\\Sentry.AspNetCore.csproj",
+ "src\\Sentry.Azure.Functions.Worker\\Sentry.Azure.Functions.Worker.csproj",
+ "src\\Sentry.DiagnosticSource\\Sentry.DiagnosticSource.csproj",
+ "src\\Sentry.EntityFramework\\Sentry.EntityFramework.csproj",
+ "src\\Sentry.Extensions.Logging\\Sentry.Extensions.Logging.csproj",
+ "src\\Sentry.Google.Cloud.Functions\\Sentry.Google.Cloud.Functions.csproj",
+ "src\\Sentry.Hangfire\\Sentry.Hangfire.csproj",
+ "src\\Sentry.Log4Net\\Sentry.Log4Net.csproj",
+ "src\\Sentry.NLog\\Sentry.NLog.csproj",
+ "src\\Sentry.OpenTelemetry\\Sentry.OpenTelemetry.csproj",
+ "src\\Sentry.Profiling\\Sentry.Profiling.csproj",
+ "src\\Sentry.Serilog\\Sentry.Serilog.csproj",
+ "src\\Sentry.SourceGenerators\\Sentry.SourceGenerators.csproj",
+ "src\\Sentry\\Sentry.csproj",
+ "test\\Sentry.Analyzers.Tests\\Sentry.Analyzers.Tests.csproj",
+ "test\\Sentry.AspNet.Tests\\Sentry.AspNet.Tests.csproj",
+ "test\\Sentry.AspNetCore.Grpc.Tests\\Sentry.AspNetCore.Grpc.Tests.csproj",
+ "test\\Sentry.AspNetCore.Tests\\Sentry.AspNetCore.Tests.csproj",
+ "test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj",
+ "test\\Sentry.Azure.Functions.Worker.Tests\\Sentry.Azure.Functions.Worker.Tests.csproj",
+ "test\\Sentry.DiagnosticSource.IntegrationTests\\Sentry.DiagnosticSource.IntegrationTests.csproj",
+ "test\\Sentry.DiagnosticSource.Tests\\Sentry.DiagnosticSource.Tests.csproj",
+ "test\\Sentry.EntityFramework.Tests\\Sentry.EntityFramework.Tests.csproj",
+ "test\\Sentry.Extensions.Logging.Tests\\Sentry.Extensions.Logging.Tests.csproj",
+ "test\\Sentry.Google.Cloud.Functions.Tests\\Sentry.Google.Cloud.Functions.Tests.csproj",
+ "test\\Sentry.Hangfire.Tests\\Sentry.Hangfire.Tests.csproj",
+ "test\\Sentry.Log4Net.Tests\\Sentry.Log4Net.Tests.csproj",
+ "test\\Sentry.NLog.Tests\\Sentry.NLog.Tests.csproj",
+ "test\\Sentry.OpenTelemetry.Tests\\Sentry.OpenTelemetry.Tests.csproj",
+ "test\\Sentry.Profiling.Tests\\Sentry.Profiling.Tests.csproj",
+ "test\\Sentry.Serilog.Tests\\Sentry.Serilog.Tests.csproj",
+ "test\\Sentry.SourceGenerators.Tests\\Sentry.SourceGenerators.Tests.csproj",
+ "test\\Sentry.Testing.CrashableApp\\Sentry.Testing.CrashableApp.csproj",
+ "test\\Sentry.Testing\\Sentry.Testing.csproj",
+ "test\\Sentry.Tests\\Sentry.Tests.csproj",
+ "test\\SingleFileTestApp\\SingleFileTestApp.csproj"
+ ]
+ }
+}
diff --git a/modules/sentry-native b/modules/sentry-native
index 19d50848fb..70982f57b6 160000
--- a/modules/sentry-native
+++ b/modules/sentry-native
@@ -1 +1 @@
-Subproject commit 19d50848fb80a7f56f98fe30fef6731b1eedb8b3
+Subproject commit 70982f57b6407a1f3afe377d0c2a61ccbbfb2ce2
diff --git a/scripts/build-sentry-native.ps1 b/scripts/build-sentry-native.ps1
index fc9d41002d..a9a1169e74 100644
--- a/scripts/build-sentry-native.ps1
+++ b/scripts/build-sentry-native.ps1
@@ -29,7 +29,14 @@ try
}
elseif ($IsLinux)
{
- $outDir += '/linux-x64'
+ if ((ldd --version 2>&1) -match 'musl')
+ {
+ $outDir += '/linux-musl-x64'
+ }
+ else
+ {
+ $outDir += '/linux-x64'
+ }
}
else
{
diff --git a/scripts/generate-solution-filters-config.yaml b/scripts/generate-solution-filters-config.yaml
index 016dd5ebc1..6c332e3ba7 100644
--- a/scripts/generate-solution-filters-config.yaml
+++ b/scripts/generate-solution-filters-config.yaml
@@ -211,3 +211,20 @@ filterConfigs:
- "**/*Bindings*"
- "**/*DeviceTests*"
- "**/*TestApp*"
+
+ # WIP: SentryNoMobile.slnf minus *Mac* for testing Linux musl CI w/o Android
+ - outputPath: Sentry-CI-Build-Linux-musl.slnf
+ solution: .generated.NoMobile.sln
+ include:
+ groups:
+ - "allProjects"
+ exclude:
+ groups:
+ - "artefacts"
+ - "trimTests"
+ patterns:
+ - "**/*Bindings*.csproj"
+ - "**/*Android*.csproj"
+ - "**/*Ios*.csproj"
+ - "**/*Mac*.csproj"
+ - "**/*Maui*.csproj"
diff --git a/src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets b/src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets
index 5ab0088570..367d8549d9 100644
--- a/src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets
+++ b/src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets
@@ -33,9 +33,9 @@
-
+
-
+