From 313c695d2187beead98934544b848d0204ba7588 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Tue, 13 May 2025 19:49:41 -0400 Subject: [PATCH 01/33] build on windows-11-arm --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f1970c21f..82c4a6a225 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: 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] + os: [ubuntu-22.04, windows-latest, windows-11-arm, macos-15] steps: - name: Checkout @@ -56,7 +56,7 @@ jobs: 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] + os: [ubuntu-22.04, windows-latest, windows-11-arm, macos-15] steps: - name: Cancel Previous Runs @@ -93,6 +93,7 @@ jobs: key: sentry-native-macOS-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true + # This step is x64 specific? - name: Download sentry-native (Windows) if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Windows') }} uses: actions/cache/restore@v4 @@ -161,7 +162,7 @@ jobs: 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] + os: [ubuntu-22.04, windows-latest, windows-11-arm, macos-15] steps: - uses: actions/checkout@v4 From 283f080a9462f697bf2c8ad7980522d2d62c3405 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 15:55:46 -0400 Subject: [PATCH 02/33] java 21 on arm64 win --- .github/actions/environment/action.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index fb702d245a..7589438918 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -19,10 +19,19 @@ runs: # Needed for Android SDK setup step - uses: actions/setup-java@v3 + if: ! (runner.os == 'Windows' && runner.arch == 'ARM64') with: distribution: 'temurin' java-version: '17' + - uses: actions/setup-java@v3 + if: runner.os == 'Windows' && runner.arch == 'ARM64' + with: + distribution: 'temurin' + # Error: Could not find satisfied version for SemVer '17'. + # Available versions: 23.0.2+7, 23.0.1+11, 21.0.7+6.0.LTS, 21.0.6+7.0.LTS, 21.0.5+11.0.LTS + java-version: '21' + - name: Setup Android SDK uses: android-actions/setup-android@07976c6290703d34c16d382cb36445f98bb43b1f # v3.2.0 with: @@ -40,12 +49,6 @@ runs: mv android-15 build-tools/35.0.0 cd - - - name: Set Java Version - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '11' - - name: Install Mono if: runner.os == 'macOS' shell: bash From f1890bd6b00969f44d20579e89d50ee000282e05 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 15:59:33 -0400 Subject: [PATCH 03/33] java --- .github/actions/environment/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 7589438918..de554a8e8a 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -19,7 +19,7 @@ runs: # Needed for Android SDK setup step - uses: actions/setup-java@v3 - if: ! (runner.os == 'Windows' && runner.arch == 'ARM64') + if: runner.os != 'Windows' && runner.arch != 'ARM64' with: distribution: 'temurin' java-version: '17' From 5ec8ed9d19cd0d631fd5fc2f682818266a5a89f0 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 16:39:36 -0400 Subject: [PATCH 04/33] java --- .github/actions/environment/action.yml | 40 ++++++++++++++------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index de554a8e8a..fc2ee82eb8 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -17,37 +17,41 @@ runs: shell: bash run: sudo xcode-select --switch /Applications/Xcode_16.2.app - # Needed for Android SDK setup step + # Java 17 is needed for Android SDK setup step + - name: Install Java 17 - uses: actions/setup-java@v3 if: runner.os != 'Windows' && runner.arch != 'ARM64' with: distribution: 'temurin' java-version: '17' - - uses: actions/setup-java@v3 + - name: Install Java 17 on Windows ARM64 if: runner.os == 'Windows' && runner.arch == 'ARM64' - with: - distribution: 'temurin' - # Error: Could not find satisfied version for SemVer '17'. - # Available versions: 23.0.2+7, 23.0.1+11, 21.0.7+6.0.LTS, 21.0.6+7.0.LTS, 21.0.5+11.0.LTS - java-version: '21' + run: | + curl -LO https://download.bell-sw.com/java/17.0.10+7/bellsoft-jdk17.0.10+7-windows-aarch64.zip + unzip bellsoft-jdk17.0.10+7-windows-aarch64.zip -d jdk17 + echo "${{ github.workspace }}/jdk17/bellsoft-jdk17.0.10+7-windows-aarch64/bin" >> $GITHUB_PATH + - name: Setup Android SDK uses: android-actions/setup-android@07976c6290703d34c16d382cb36445f98bb43b1f # v3.2.0 with: log-accepted-android-sdk-licenses: false - # https://github.com/actions/runner-images/issues/10814 - - name: Workaround build-tools issue - if: runner.os == 'macOS' - shell: bash - run: | - curl https://dl.google.com/android/repository/build-tools_r35_macosx.zip > $ANDROID_HOME/build-tools_r35_macosx.zip - cd $ANDROID_HOME - mkdir -p build-tools - unzip build-tools_r35_macosx.zip - mv android-15 build-tools/35.0.0 - cd - + # Java 11 is needed by .NET Android + # - name: Install Java 11 + # if: runner.os != 'Windows' && runner.arch != 'ARM64' + # uses: actions/setup-java@v3 + # with: + # distribution: 'temurin' + # java-version: '11' + + - name: Install Java 11 # on Windows ARM64 + # if: runner.os == 'Windows' && runner.arch == 'ARM64' + uses: actions/setup-java@v3 + with: + distribution: 'microsoft' + java-version: '11' - name: Install Mono if: runner.os == 'macOS' From f366998770c98aa3511ed5eee8bc5178ac69f589 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 16:55:17 -0400 Subject: [PATCH 05/33] java with shel --- .github/actions/environment/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index fc2ee82eb8..1482394b8d 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -27,6 +27,7 @@ runs: - name: Install Java 17 on Windows ARM64 if: runner.os == 'Windows' && runner.arch == 'ARM64' + shell: bash run: | curl -LO https://download.bell-sw.com/java/17.0.10+7/bellsoft-jdk17.0.10+7-windows-aarch64.zip unzip bellsoft-jdk17.0.10+7-windows-aarch64.zip -d jdk17 From 0834456ae902158953489126f3467a27f35102e7 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 16:56:46 -0400 Subject: [PATCH 06/33] java with shel --- .github/actions/environment/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 1482394b8d..210c97dc0e 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -19,7 +19,7 @@ runs: # Java 17 is needed for Android SDK setup step - name: Install Java 17 - - uses: actions/setup-java@v3 + uses: actions/setup-java@v3 if: runner.os != 'Windows' && runner.arch != 'ARM64' with: distribution: 'temurin' From 191004a809741fdaed053c5bceb62c1ecf2a4673 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 17:21:42 -0400 Subject: [PATCH 07/33] add arch to stuff --- .github/workflows/build.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82c4a6a225..0cf07f2806 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ on: jobs: build-sentry-native: - name: sentry-native (${{ matrix.os }}) + name: sentry-native (${{ matrix.os }}-${{ runner.arch }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -30,7 +30,7 @@ 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-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} enableCrossOsArchive: true - name: Remove unused applications @@ -94,6 +94,7 @@ jobs: fail-on-cache-miss: true # This step is x64 specific? + # Blocked by: https://github.com/getsentry/sentry-native/issues/880 - name: Download sentry-native (Windows) if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Windows') }} uses: actions/cache/restore@v4 @@ -136,13 +137,13 @@ jobs: name: ${{ 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. + # To save time and disk space, we only create and archive the NuGet packages when we're actually releasing. - - name: Create Nuget Packages + - name: Create NuGet Packages if: env.CI_PUBLISHING_BUILD == 'true' run: dotnet pack Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-build --nologo - - name: Archive Nuget Packages + - name: Archive NuGet Packages if: env.CI_PUBLISHING_BUILD == 'true' uses: actions/upload-artifact@v4 with: @@ -162,7 +163,8 @@ jobs: 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, windows-11-arm, macos-15] + os: [ubuntu-22.04, windows-latest, macos-15] + # os: [ubuntu-22.04, windows-latest, windows-11-arm, macos-15] steps: - uses: actions/checkout@v4 From 67f13ccf303a461bc0b13c4915c2b5e163fea250 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 17:31:50 -0400 Subject: [PATCH 08/33] matrix with arch --- .github/workflows/build.yml | 45 ++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0cf07f2806..e067235bf2 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 }}-${{ runner.arch }}) + name: sentry-native (${{ matrix.os }}-${{ matrix.arch }}) runs-on: ${{ matrix.os }} 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, windows-11-arm, macos-15] + include: + - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed + arch: x64 + - os: windows-11-arm + arch: arm64 + - os: windows-latest + arch: x64 + - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 + arch: arm64 steps: - name: Checkout @@ -30,7 +36,9 @@ jobs: id: cache with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-${{ runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + # This will fail since sentry-native doesn't yet build on arm64 so for now using the cached version of x64 to test CI passed this step + # key: sentry-native-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} enableCrossOsArchive: true - name: Remove unused applications @@ -54,9 +62,15 @@ jobs: 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, windows-11-arm, macos-15] + include: + - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed + arch: x64 + - os: windows-11-arm + arch: arm64 + - os: windows-latest + arch: x64 + - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 + arch: arm64 steps: - name: Cancel Previous Runs @@ -161,10 +175,15 @@ jobs: 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] - # os: [ubuntu-22.04, windows-latest, windows-11-arm, macos-15] + include: + - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed + arch: x64 + - os: windows-11-arm + arch: arm64 + - os: windows-latest + arch: x64 + - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 + arch: arm64 steps: - uses: actions/checkout@v4 @@ -176,7 +195,7 @@ jobs: integration-test .github - - name: Fetch Nuget Packages + - name: Fetch NuGet Packages uses: actions/download-artifact@v4 with: name: ${{ github.sha }} From fa50b1d914b1ad96b18d8257187b845d8b69298a Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 17:43:25 -0400 Subject: [PATCH 09/33] java --- .github/actions/environment/action.yml | 31 +++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 210c97dc0e..f8798792d8 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -19,7 +19,7 @@ runs: # Java 17 is needed for Android SDK setup step - name: Install Java 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 if: runner.os != 'Windows' && runner.arch != 'ARM64' with: distribution: 'temurin' @@ -27,11 +27,11 @@ runs: - name: Install Java 17 on Windows ARM64 if: runner.os == 'Windows' && runner.arch == 'ARM64' - shell: bash - run: | - curl -LO https://download.bell-sw.com/java/17.0.10+7/bellsoft-jdk17.0.10+7-windows-aarch64.zip - unzip bellsoft-jdk17.0.10+7-windows-aarch64.zip -d jdk17 - echo "${{ github.workspace }}/jdk17/bellsoft-jdk17.0.10+7-windows-aarch64/bin" >> $GITHUB_PATH + uses: actions/setup-java@v4 + with: + distribution: 'microsoft' + java-version: '17' + architecture: 'aarch64' - name: Setup Android SDK @@ -40,18 +40,19 @@ runs: log-accepted-android-sdk-licenses: false # Java 11 is needed by .NET Android - # - name: Install Java 11 - # if: runner.os != 'Windows' && runner.arch != 'ARM64' - # uses: actions/setup-java@v3 - # with: - # distribution: 'temurin' - # java-version: '11' + - name: Install Java 11 + if: runner.os != 'Windows' && runner.arch != 'ARM64' + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '11' - - name: Install Java 11 # on Windows ARM64 - # if: runner.os == 'Windows' && runner.arch == 'ARM64' - uses: actions/setup-java@v3 + - name: Install Java 11 on Windows ARM64 + if: runner.os == 'Windows' && runner.arch == 'ARM64' + uses: actions/setup-java@v4 with: distribution: 'microsoft' + architecture: 'aarch64' java-version: '11' - name: Install Mono From 9d8f3c6a9579fa2c4838804d8bf89413c9243fda Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 18:17:49 -0400 Subject: [PATCH 10/33] fix condition --- .github/actions/environment/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index f8798792d8..95486394c0 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -20,7 +20,7 @@ runs: # Java 17 is needed for Android SDK setup step - name: Install Java 17 uses: actions/setup-java@v4 - if: runner.os != 'Windows' && runner.arch != 'ARM64' + if: ${{ !(runner.os == 'Windows' && runner.arch == 'ARM64') }} with: distribution: 'temurin' java-version: '17' @@ -33,7 +33,6 @@ runs: java-version: '17' architecture: 'aarch64' - - name: Setup Android SDK uses: android-actions/setup-android@07976c6290703d34c16d382cb36445f98bb43b1f # v3.2.0 with: From 891a865fc776222ff61e4c188e8ff52b825a8172 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 18:36:15 -0400 Subject: [PATCH 11/33] sln filter --- .github/workflows/build.yml | 13 ++- Sentry-CI-Build-Windows-arm64.slnf | 81 +++++++++++++++++++ scripts/generate-solution-filters-config.yaml | 21 +++++ 3 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 Sentry-CI-Build-Windows-arm64.slnf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e067235bf2..bd84958e19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,20 +11,17 @@ on: jobs: build-sentry-native: - name: sentry-native (${{ matrix.os }}-${{ matrix.arch }}) + name: sentry-native (${{ matrix.os }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed - arch: x64 - os: windows-11-arm arch: arm64 - os: windows-latest - arch: x64 - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 - arch: arm64 steps: - name: Checkout @@ -125,11 +122,11 @@ jobs: 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.arch && format('{0}-{1}', runner.os, matrix.arch) || 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.arch && format('{0}-{1}', runner.os, matrix.arch) || 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' }} @@ -139,7 +136,7 @@ jobs: 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.arch && format('{0}-{1}', runner.os, matrix.arch) || 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 @@ -155,7 +152,7 @@ jobs: - 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.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}.slnf -c Release --no-build --nologo - name: Archive NuGet Packages if: env.CI_PUBLISHING_BUILD == 'true' diff --git a/Sentry-CI-Build-Windows-arm64.slnf b/Sentry-CI-Build-Windows-arm64.slnf new file mode 100644 index 0000000000..fe7eba78e2 --- /dev/null +++ b/Sentry-CI-Build-Windows-arm64.slnf @@ -0,0 +1,81 @@ +{ + "solution": { + "path": "Sentry.sln", + "projects": [ + "benchmarks\\Sentry.Benchmarks\\Sentry.Benchmarks.csproj", + "modules\\perfview\\src\\FastSerialization\\FastSerialization.csproj", + "modules\\perfview\\src\\TraceEvent\\TraceEvent.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.Maui\\Sentry.Samples.Maui.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.Android.AssemblyReader\\Sentry.Android.AssemblyReader.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.Bindings.Android\\Sentry.Bindings.Android.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.Maui\\Sentry.Maui.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.Android.AssemblyReader.Tests\\Sentry.Android.AssemblyReader.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.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.Maui.Tests\\Sentry.Maui.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/scripts/generate-solution-filters-config.yaml b/scripts/generate-solution-filters-config.yaml index 016dd5ebc1..a46c230ec7 100644 --- a/scripts/generate-solution-filters-config.yaml +++ b/scripts/generate-solution-filters-config.yaml @@ -83,6 +83,27 @@ filterConfigs: - "**/*Sentry.Samples.Android.csproj" - "**/*OpenTelemetry.AspNet.csproj" + - outputPath: Sentry-CI-Build-Windows-arm64.slnf + include: + groups: + - "allProjects" + patterns: + - "modules/perfview/**/TraceEvent.csproj" + - "modules/perfview/**/FastSerialization.csproj" + exclude: + groups: + - "macOnly" + - "artefacts" + - "trimTests" + patterns: + - "**/*AndroidTestApp.csproj" + - "**/*DeviceTests*.csproj" + - "**/*Sentry.Maui.Device.TestApp.csproj" + - "**/*Sentry.Samples.Android.csproj" + - "**/*OpenTelemetry.AspNet.csproj" + # Depends on LocalDb which is x64 + - "**/*Sentry.DiagnosticSource.IntegrationTests.csproj" + - outputPath: Sentry-CI-CodeQL.slnf include: groups: From eaa9a5d70289a2e68a8e50147f7ddaaf988fcc2f Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 18:42:19 -0400 Subject: [PATCH 12/33] fix java 11 outside windows --- .github/actions/environment/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 95486394c0..64a27937a8 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -40,7 +40,7 @@ runs: # Java 11 is needed by .NET Android - name: Install Java 11 - if: runner.os != 'Windows' && runner.arch != 'ARM64' + if: ${{ !(runner.os == 'Windows' && runner.arch == 'ARM64') }} uses: actions/setup-java@v4 with: distribution: 'temurin' From d8a669f4cc44c75c592a670af8d5021d43581ae9 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 18:51:21 -0400 Subject: [PATCH 13/33] copy pasta never ends --- .github/workflows/build.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd84958e19..267010a209 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,10 +18,10 @@ jobs: matrix: include: - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed + - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 + - os: windows-latest - os: windows-11-arm arch: arm64 - - 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 @@ -61,12 +61,9 @@ jobs: matrix: include: - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed - arch: x64 - - os: windows-11-arm - arch: arm64 - - os: windows-latest - arch: x64 - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 + - os: windows-latest + - os: windows-11-arm arch: arm64 steps: @@ -174,12 +171,9 @@ jobs: matrix: include: - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed - arch: x64 - - os: windows-11-arm - arch: arm64 - - os: windows-latest - arch: x64 - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 + - os: windows-latest + - os: windows-11-arm arch: arm64 steps: From e7d93a59b7a643e6878c0fe9a1f84d169f888356 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 19:19:21 -0400 Subject: [PATCH 14/33] demove localdb stuff from arm --- .github/workflows/build.yml | 4 ++-- Sentry-CI-Build-Windows-arm64.slnf | 1 - scripts/generate-solution-filters-config.yaml | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 267010a209..d5baed8cef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,7 +129,7 @@ jobs: if: ${{ steps.build.outcome != 'skipped' }} uses: actions/upload-artifact@v4 with: - name: ${{ runner.os }}-build-logs + name: ${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}-build-logs path: build.binlog - name: Test @@ -142,7 +142,7 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: ${{ runner.os }}-verify-test-results + name: ${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || 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. diff --git a/Sentry-CI-Build-Windows-arm64.slnf b/Sentry-CI-Build-Windows-arm64.slnf index fe7eba78e2..b6ebe13843 100644 --- a/Sentry-CI-Build-Windows-arm64.slnf +++ b/Sentry-CI-Build-Windows-arm64.slnf @@ -61,7 +61,6 @@ "test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj", "test\\Sentry.Azure.Functions.Worker.Tests\\Sentry.Azure.Functions.Worker.Tests.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", diff --git a/scripts/generate-solution-filters-config.yaml b/scripts/generate-solution-filters-config.yaml index a46c230ec7..0c4dbc6650 100644 --- a/scripts/generate-solution-filters-config.yaml +++ b/scripts/generate-solution-filters-config.yaml @@ -103,6 +103,7 @@ filterConfigs: - "**/*OpenTelemetry.AspNet.csproj" # Depends on LocalDb which is x64 - "**/*Sentry.DiagnosticSource.IntegrationTests.csproj" + - "**/*Sentry.EntityFramework.Tests.csproj" - outputPath: Sentry-CI-CodeQL.slnf include: From 98512ccea8ab023842f2125efec1d422c8c77649 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 20:23:11 -0400 Subject: [PATCH 15/33] depend on sentry-native --- CHANGELOG.md | 6 ++++++ integration-test/runtime.Tests.ps1 | 9 ++++++++- scripts/build-sentry-native.ps1 | 11 ++++++++++- scripts/generate-solution-filters-config.yaml | 3 ++- src/Sentry/Platforms/Native/Sentry.Native.targets | 14 ++++++++++++-- .../Native/buildTransitive/Sentry.Native.targets | 4 ++-- 6 files changed, 40 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5b1515a0f..f1ec68bb1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### Unreleased + +### Feature + +- Support for Windows ARM64 with Native AOT ([#4187](https://github.com/getsentry/sentry-dotnet/pull/4187)) + ## 5.7.0 ### Features diff --git a/integration-test/runtime.Tests.ps1 b/integration-test/runtime.Tests.ps1 index 3c66524006..81f75fe245 100644 --- a/integration-test/runtime.Tests.ps1 +++ b/integration-test/runtime.Tests.ps1 @@ -49,7 +49,14 @@ internal class FakeTransport : ITransport } elseif ($IsWindows) { - return "./console-app/bin/Release/$framework/win-x64/publish/console-app.exe" + if ("Arm64".Equals([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString())) + { + return "./console-app/bin/Release/$framework/win-arm64/publish/console-app.exe" + } + else + { + return "./console-app/bin/Release/$framework/win-x64/publish/console-app.exe" + } } else { diff --git a/scripts/build-sentry-native.ps1 b/scripts/build-sentry-native.ps1 index fc9d41002d..eb8f5b7d73 100644 --- a/scripts/build-sentry-native.ps1 +++ b/scripts/build-sentry-native.ps1 @@ -21,11 +21,20 @@ try } elseif ($IsWindows) { - $outDir += '/win-x64' + # TODO: Blocked on: https://github.com/getsentry/sentry-native/issues/880 $additionalArgs += @('-C', 'src/Sentry/Platforms/Native/windows-config.cmake') $actualBuildDir = "$buildDir/RelWithDebInfo" $libPrefix = '' $libExtension = '.lib' + + if ("Arm64".Equals([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString())) + { + $outDir += '/win-x64' + } + else + { + $outDir += '/win-arm64' + } } elseif ($IsLinux) { diff --git a/scripts/generate-solution-filters-config.yaml b/scripts/generate-solution-filters-config.yaml index 0c4dbc6650..e882e19591 100644 --- a/scripts/generate-solution-filters-config.yaml +++ b/scripts/generate-solution-filters-config.yaml @@ -101,8 +101,9 @@ filterConfigs: - "**/*Sentry.Maui.Device.TestApp.csproj" - "**/*Sentry.Samples.Android.csproj" - "**/*OpenTelemetry.AspNet.csproj" - # Depends on LocalDb which is x64 + # Depends on LocalDb or SQLitePCL which are x64 - "**/*Sentry.DiagnosticSource.IntegrationTests.csproj" + - "**/*Sentry.DiagnosticSource.Tests.csproj" - "**/*Sentry.EntityFramework.Tests.csproj" - outputPath: Sentry-CI-CodeQL.slnf diff --git a/src/Sentry/Platforms/Native/Sentry.Native.targets b/src/Sentry/Platforms/Native/Sentry.Native.targets index a69113be5e..a03d405f27 100644 --- a/src/Sentry/Platforms/Native/Sentry.Native.targets +++ b/src/Sentry/Platforms/Native/Sentry.Native.targets @@ -9,11 +9,14 @@ win-x64 $(SentryNativeOutputDirectory)$(NativeLibRelativePath-win-x64)\ + win-arm64 + $(SentryNativeOutputDirectory)$(NativeLibRelativePath-win-arm64)\ linux-x64 $(SentryNativeOutputDirectory)$(NativeLibRelativePath-linux-x64)\ osx $(SentryNativeOutputDirectory)$(NativeLibRelativePath-osx)\ - $(SentryNativeOutputDirectory-win-x64)$(SentryNativeLibraryName).lib + $(SentryNativeOutputDirectory-win-x64)lib$(SentryNativeLibraryName).lib + $(SentryNativeOutputDirectory-win-arm64)lib$(SentryNativeLibraryName).lib $(SentryNativeOutputDirectory-linux-x64)lib$(SentryNativeLibraryName).a $(SentryNativeOutputDirectory-osx)lib$(SentryNativeLibraryName).a @@ -25,13 +28,20 @@ - + true \sentry-native\$(NativeLibRelativePath-win-x64) + + + true + \sentry-native\$(NativeLibRelativePath-win-arm64) + + + true diff --git a/src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets b/src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets index 5ab0088570..7b3e800790 100644 --- a/src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets +++ b/src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets @@ -25,9 +25,9 @@ false - + - + From 90c3dd6e7a22bfcdd6b53ef1b4bce5ef9b76091b Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 20:30:14 -0400 Subject: [PATCH 16/33] fix arch --- scripts/build-sentry-native.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-sentry-native.ps1 b/scripts/build-sentry-native.ps1 index eb8f5b7d73..ceb4e22fa8 100644 --- a/scripts/build-sentry-native.ps1 +++ b/scripts/build-sentry-native.ps1 @@ -29,11 +29,11 @@ try if ("Arm64".Equals([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString())) { - $outDir += '/win-x64' + $outDir += '/win-arm64' } else { - $outDir += '/win-arm64' + $outDir += '/win-x64' } } elseif ($IsLinux) From 46cd05eb2911b008bff9f7c1735a358e20690103 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sat, 17 May 2025 21:03:36 -0400 Subject: [PATCH 17/33] remove sql test from arm --- Sentry-CI-Build-Windows-arm64.slnf | 1 - 1 file changed, 1 deletion(-) diff --git a/Sentry-CI-Build-Windows-arm64.slnf b/Sentry-CI-Build-Windows-arm64.slnf index b6ebe13843..cf80ef7eb1 100644 --- a/Sentry-CI-Build-Windows-arm64.slnf +++ b/Sentry-CI-Build-Windows-arm64.slnf @@ -60,7 +60,6 @@ "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.Tests\\Sentry.DiagnosticSource.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", From 8e80e4ac6d8da565c33364eca9a2aab3c6a64ea1 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Sun, 18 May 2025 13:08:39 -0400 Subject: [PATCH 18/33] use platform aware cache key for sentry-native windows --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5baed8cef..3c1e30fbd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,9 +33,11 @@ jobs: id: cache with: path: src/Sentry/Platforms/Native/sentry-native + # TODO: Remove this in favor of the line below key: sentry-native-${{ runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} # This will fail since sentry-native doesn't yet build on arm64 so for now using the cached version of x64 to test CI passed this step - # key: sentry-native-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + # On Windows, it'll be either: Windows or Windows-arm64: + # key: sentry-native-${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} enableCrossOsArchive: true - name: Remove unused applications @@ -108,7 +110,7 @@ jobs: uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-Windows-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true enableCrossOsArchive: true @@ -218,7 +220,7 @@ jobs: submodules: recursive fetch-depth: 2 # default is 1 and codecov needs > 1 - # We use macOS for the final publishing build so we get all the iOS/macCatalyst targets in the packages + # We use macOS for the final publishing build so we get all the iOS/Mac Catalyst targets in the packages - name: Set Environment Variables run: echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV From 468f82f7f59b18634e0dd0ac66091cdbf60e6b76 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 19 May 2025 20:16:32 +0200 Subject: [PATCH 19/33] Fix Windows vs. Windows-arm64 cache key Downloads are separate steps because macOS (CI_PUBLISHING_BUILD) needs to download both. --- .github/workflows/build.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c1e30fbd0..d3cd5177ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,11 +33,8 @@ jobs: id: cache with: path: src/Sentry/Platforms/Native/sentry-native - # TODO: Remove this in favor of the line below - key: sentry-native-${{ runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} - # This will fail since sentry-native doesn't yet build on arm64 so for now using the cached version of x64 to test CI passed this step # On Windows, it'll be either: Windows or Windows-arm64: - # key: sentry-native-${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} enableCrossOsArchive: true - name: Remove unused applications @@ -103,14 +100,21 @@ jobs: key: sentry-native-macOS-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true - # This step is x64 specific? - # Blocked by: https://github.com/getsentry/sentry-native/issues/880 - name: Download sentry-native (Windows) - if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Windows') }} + if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Windows' && runner.arch == 'X64') }} uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-Windows-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + fail-on-cache-miss: true + enableCrossOsArchive: true + + - name: Download sentry-native (Windows arm64) + if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Windows' && runner.arch == 'ARM64') }} + uses: actions/cache/restore@v4 + with: + path: src/Sentry/Platforms/Native/sentry-native + key: sentry-native-Windows-arm64-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true enableCrossOsArchive: true From dcf50fe73eea55afdabe661449677a2d4542e30e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 19 May 2025 22:12:51 +0200 Subject: [PATCH 20/33] install missing zstd for cross-os cache --- .github/actions/environment/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 64a27937a8..0f02e599de 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -11,6 +11,11 @@ runs: echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV echo "DOTNET_NOLOGO=1" >> $GITHUB_ENV + # zstd is needed for cross OS actions/cache but missing from windows-11-arm + - name: Install zstd on Windows ARM64 + run: choco install zstandard + if: runner.os == 'Windows' && runner.arch == 'ARM64' + # See https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode - name: Pin the Xcode Version if: runner.os == 'macOS' From b10ab7c109637b0afce81776d1bae9539e4979ec Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 19 May 2025 22:15:15 +0200 Subject: [PATCH 21/33] add missing shell --- .github/actions/environment/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 0f02e599de..002e5edb79 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -13,8 +13,9 @@ runs: # zstd is needed for cross OS actions/cache but missing from windows-11-arm - name: Install zstd on Windows ARM64 - run: choco install zstandard if: runner.os == 'Windows' && runner.arch == 'ARM64' + shell: pwsh + run: choco install zstandard # See https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode - name: Pin the Xcode Version From 793663b536eb8556f316c143bc53ed8fc0ca0ba3 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 19 May 2025 22:25:02 +0200 Subject: [PATCH 22/33] move zstd installation into build-sentry-native --- .github/actions/environment/action.yml | 6 ------ .github/workflows/build.yml | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 002e5edb79..64a27937a8 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -11,12 +11,6 @@ runs: echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV echo "DOTNET_NOLOGO=1" >> $GITHUB_ENV - # zstd is needed for cross OS actions/cache but missing from windows-11-arm - - name: Install zstd on Windows ARM64 - if: runner.os == 'Windows' && runner.arch == 'ARM64' - shell: pwsh - run: choco install zstandard - # See https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode - name: Pin the Xcode Version if: runner.os == 'macOS' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3cd5177ac..97c837655b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,12 @@ jobs: - run: git submodule update --init modules/sentry-native + # zstd is needed for cross OS actions/cache but missing from windows-11-arm + - name: Install zstd on Windows ARM64 + if: runner.os == 'Windows' && runner.arch == 'ARM64' + shell: pwsh + run: choco install zstandard + - uses: actions/cache@v4 id: cache with: From 7c44c3af278c381981609a417bdc8593a21d2b0f Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 19 May 2025 22:33:48 +0200 Subject: [PATCH 23/33] run pwsh scripts/generate-solution-filters.ps1 --- Sentry-CI-Build-Windows-arm64.slnf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sentry-CI-Build-Windows-arm64.slnf b/Sentry-CI-Build-Windows-arm64.slnf index cf80ef7eb1..c1f6bd735d 100644 --- a/Sentry-CI-Build-Windows-arm64.slnf +++ b/Sentry-CI-Build-Windows-arm64.slnf @@ -46,6 +46,7 @@ "src\\Sentry.Google.Cloud.Functions\\Sentry.Google.Cloud.Functions.csproj", "src\\Sentry.Hangfire\\Sentry.Hangfire.csproj", "src\\Sentry.Log4Net\\Sentry.Log4Net.csproj", + "src\\Sentry.Maui.CommunityToolkit.Mvvm\\Sentry.Maui.CommunityToolkit.Mvvm.csproj", "src\\Sentry.Maui\\Sentry.Maui.csproj", "src\\Sentry.NLog\\Sentry.NLog.csproj", "src\\Sentry.OpenTelemetry\\Sentry.OpenTelemetry.csproj", @@ -64,6 +65,7 @@ "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.Maui.CommunityToolkit.Mvvm.Tests\\Sentry.Maui.CommunityToolkit.Mvvm.Tests.csproj", "test\\Sentry.Maui.Tests\\Sentry.Maui.Tests.csproj", "test\\Sentry.NLog.Tests\\Sentry.NLog.Tests.csproj", "test\\Sentry.OpenTelemetry.Tests\\Sentry.OpenTelemetry.Tests.csproj", From 1c0a17e64e7963366eb0eff5bf2314aa55f20f42 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 19 May 2025 22:34:50 +0200 Subject: [PATCH 24/33] install zstd for restoring too --- .github/actions/environment/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 64a27937a8..002e5edb79 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -11,6 +11,12 @@ runs: echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" >> $GITHUB_ENV echo "DOTNET_NOLOGO=1" >> $GITHUB_ENV + # zstd is needed for cross OS actions/cache but missing from windows-11-arm + - name: Install zstd on Windows ARM64 + if: runner.os == 'Windows' && runner.arch == 'ARM64' + shell: pwsh + run: choco install zstandard + # See https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode - name: Pin the Xcode Version if: runner.os == 'macOS' From 0aa8d289d6e0e36a06946cbba8c83a5571ba0912 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 19 May 2025 22:39:05 +0200 Subject: [PATCH 25/33] setup env before cache restore --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97c837655b..3900f08145 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,6 +85,9 @@ jobs: - name: Remove unused applications uses: ./.github/actions/freediskspace + - name: Setup Environment + uses: ./.github/actions/environment + # We use macOS for the final publishing build so we get all the iOS/macCatalyst targets in the packages - name: Set Environment Variables if: runner.os == 'macOS' @@ -124,9 +127,6 @@ jobs: fail-on-cache-miss: true enableCrossOsArchive: true - - name: Setup Environment - uses: ./.github/actions/environment - - name: Build Native Dependencies uses: ./.github/actions/buildnative From 0359a55f4e93f1c7397e00c09283cbcfbf42d810 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 20 May 2025 12:29:32 +0200 Subject: [PATCH 26/33] simplify java setup --- .github/actions/environment/action.yml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 002e5edb79..8391ab820d 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -26,19 +26,10 @@ runs: # Java 17 is needed for Android SDK setup step - name: Install Java 17 uses: actions/setup-java@v4 - if: ${{ !(runner.os == 'Windows' && runner.arch == 'ARM64') }} with: - distribution: 'temurin' + distribution: ${{ runner.os == 'Windows' && runner.arch == 'ARM64' && 'microsoft' || 'temurin' }} java-version: '17' - - name: Install Java 17 on Windows ARM64 - if: runner.os == 'Windows' && runner.arch == 'ARM64' - uses: actions/setup-java@v4 - with: - distribution: 'microsoft' - java-version: '17' - architecture: 'aarch64' - - name: Setup Android SDK uses: android-actions/setup-android@07976c6290703d34c16d382cb36445f98bb43b1f # v3.2.0 with: @@ -46,18 +37,9 @@ runs: # Java 11 is needed by .NET Android - name: Install Java 11 - if: ${{ !(runner.os == 'Windows' && runner.arch == 'ARM64') }} - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '11' - - - name: Install Java 11 on Windows ARM64 - if: runner.os == 'Windows' && runner.arch == 'ARM64' uses: actions/setup-java@v4 with: - distribution: 'microsoft' - architecture: 'aarch64' + distribution: ${{ runner.os == 'Windows' && runner.arch == 'ARM64' && 'microsoft' || 'temurin' }} java-version: '11' - name: Install Mono From 3d50cf2afa4ca84073adb216f5ef57e060e9ddc1 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 20 May 2025 12:30:19 +0200 Subject: [PATCH 27/33] remove outdated TODO comment --- scripts/build-sentry-native.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/build-sentry-native.ps1 b/scripts/build-sentry-native.ps1 index ceb4e22fa8..d0137fcb14 100644 --- a/scripts/build-sentry-native.ps1 +++ b/scripts/build-sentry-native.ps1 @@ -21,7 +21,6 @@ try } elseif ($IsWindows) { - # TODO: Blocked on: https://github.com/getsentry/sentry-native/issues/880 $additionalArgs += @('-C', 'src/Sentry/Platforms/Native/windows-config.cmake') $actualBuildDir = "$buildDir/RelWithDebInfo" $libPrefix = '' From d59af89a84800bc7d4e70bc31c205ac1494a0c93 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 20 May 2025 12:30:53 +0200 Subject: [PATCH 28/33] add zstd on windows-11-arm issue links --- .github/actions/environment/action.yml | 1 + .github/workflows/build.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/actions/environment/action.yml b/.github/actions/environment/action.yml index 8391ab820d..5e4c5e836f 100644 --- a/.github/actions/environment/action.yml +++ b/.github/actions/environment/action.yml @@ -12,6 +12,7 @@ runs: echo "DOTNET_NOLOGO=1" >> $GITHUB_ENV # zstd is needed for cross OS actions/cache but missing from windows-11-arm + # https://github.com/actions/partner-runner-images/issues/99 - name: Install zstd on Windows ARM64 if: runner.os == 'Windows' && runner.arch == 'ARM64' shell: pwsh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3900f08145..e1a6b6202f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,7 @@ jobs: - run: git submodule update --init modules/sentry-native # zstd is needed for cross OS actions/cache but missing from windows-11-arm + # https://github.com/actions/partner-runner-images/issues/99 - name: Install zstd on Windows ARM64 if: runner.os == 'Windows' && runner.arch == 'ARM64' shell: pwsh From 077f53b2a149e9d25e99a4f796de386b6b4dbf79 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 20 May 2025 12:31:26 +0200 Subject: [PATCH 29/33] trim-analysis depends on build-sentry-native --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1a6b6202f..7efe7d4a75 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -221,6 +221,7 @@ jobs: trim-analysis: + needs: build-sentry-native name: Trim analysis runs-on: macos-15 From 3af984dbbfbe4e133490e640c2ced4c2c24b1e25 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 20 May 2025 12:31:46 +0200 Subject: [PATCH 30/33] use matrix.os for cache & matrix.slnf for solution filter --- .github/workflows/build.yml | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7efe7d4a75..0f91be0000 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ on: jobs: build-sentry-native: - name: sentry-native (${{ matrix.os }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} + name: sentry-native (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -21,7 +21,6 @@ jobs: - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 - os: windows-latest - os: windows-11-arm - arch: arm64 steps: - name: Checkout @@ -40,8 +39,7 @@ jobs: id: cache with: path: src/Sentry/Platforms/Native/sentry-native - # On Windows, it'll be either: Windows or Windows-arm64: - key: sentry-native-${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-${{ matrix.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} enableCrossOsArchive: true - name: Remove unused applications @@ -67,10 +65,13 @@ jobs: matrix: include: - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed + slnf: Sentry-CI-Build-Linux.slnf - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 + slnf: Sentry-CI-Build-macOS.slnf - os: windows-latest + slnf: Sentry-CI-Build-Windows.slnf - os: windows-11-arm - arch: arm64 + slnf: Sentry-CI-Build-Windows-arm64.slnf steps: - name: Cancel Previous Runs @@ -95,36 +96,36 @@ 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.os == 'ubuntu-22.04') }} 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') }} + key: sentry-native-ubuntu-22.04-${{ 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') }} + if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.os == 'macos-15') }} uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-macOS-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-macos-15-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true - name: Download sentry-native (Windows) - if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Windows' && runner.arch == 'X64') }} + if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.os == 'windows-latest') }} uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-Windows-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-windows-latest-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true enableCrossOsArchive: true - name: Download sentry-native (Windows arm64) - if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Windows' && runner.arch == 'ARM64') }} + if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.os == 'windows-11-arm') }} uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-Windows-arm64-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-windows-11-arm-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true enableCrossOsArchive: true @@ -132,21 +133,21 @@ jobs: uses: ./.github/actions/buildnative - name: Restore .NET Dependencies - run: dotnet restore Sentry-CI-Build-${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}.slnf --nologo + run: dotnet restore ${{ matrix.slnf }} --nologo - name: Build id: build - run: dotnet build Sentry-CI-Build-${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}.slnf -c Release --no-restore --nologo -v:minimal -flp:logfile=build.log -p:CopyLocalLockFileAssemblies=true -bl:build.binlog + run: dotnet build ${{ matrix.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: ${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}-build-logs + name: ${{ matrix.os }}-build-logs path: build.binlog - name: Test - run: dotnet test Sentry-CI-Build-${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}.slnf -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}" --collect "XPlat Code Coverage" + run: dotnet test ${{ matrix.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 @@ -155,14 +156,14 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: ${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}-verify-test-results + name: ${{ matrix.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-${{ matrix.arch && format('{0}-{1}', runner.os, matrix.arch) || runner.os }}.slnf -c Release --no-build --nologo + run: dotnet pack ${{ matrix.slnf }} -c Release --no-build --nologo - name: Archive NuGet Packages if: env.CI_PUBLISHING_BUILD == 'true' @@ -187,7 +188,6 @@ jobs: - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 - os: windows-latest - os: windows-11-arm - arch: arm64 steps: - uses: actions/checkout@v4 @@ -240,7 +240,7 @@ jobs: uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-macOS-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-macos-15-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true - name: Setup Environment From 86019e7c70e826b93f8e9fd5f797333f01ebde40 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 21 May 2025 21:51:56 +0200 Subject: [PATCH 31/33] avoid error-prone matrix.os as cache key --- .github/workflows/build.yml | 38 ++++++++++++++++----------------- scripts/build-sentry-native.ps1 | 2 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f91be0000..ce890fc850 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,7 @@ jobs: - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 - os: windows-latest - os: windows-11-arm + target: Windows-arm64 steps: - name: Checkout @@ -39,7 +40,7 @@ jobs: id: cache with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-${{ matrix.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 @@ -65,13 +66,10 @@ jobs: matrix: include: - os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed - slnf: Sentry-CI-Build-Linux.slnf - os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 - slnf: Sentry-CI-Build-macOS.slnf - os: windows-latest - slnf: Sentry-CI-Build-Windows.slnf - os: windows-11-arm - slnf: Sentry-CI-Build-Windows-arm64.slnf + target: Windows-arm64 steps: - name: Cancel Previous Runs @@ -96,36 +94,36 @@ jobs: run: echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV - name: Download sentry-native (Linux) - if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.os == 'ubuntu-22.04') }} + if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Linux') }} uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-ubuntu-22.04-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + 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 (macOS) - if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.os == 'macos-15') }} + if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'macOS') }} uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-macos-15-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-macOS-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true - name: Download sentry-native (Windows) - if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.os == 'windows-latest') }} + if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Windows' && runner.arch == 'X64') }} uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-windows-latest-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-Windows-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true enableCrossOsArchive: true - name: Download sentry-native (Windows arm64) - if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.os == 'windows-11-arm') }} + if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Windows' && runner.arch == 'ARM64') }} uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-windows-11-arm-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-Windows-arm64-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true enableCrossOsArchive: true @@ -133,21 +131,21 @@ jobs: uses: ./.github/actions/buildnative - name: Restore .NET Dependencies - run: dotnet restore ${{ matrix.slnf }} --nologo + run: dotnet restore Sentry-CI-Build-${{ matrix.target || runner.os }}.slnf --nologo - name: Build id: build - run: dotnet build ${{ matrix.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 }} -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: ${{ matrix.os }}-build-logs + name: ${{ matrix.target || runner.os }}-build-logs path: build.binlog - name: Test - run: dotnet test ${{ matrix.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 @@ -156,14 +154,14 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: ${{ matrix.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 ${{ matrix.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' @@ -240,7 +238,7 @@ jobs: uses: actions/cache/restore@v4 with: path: src/Sentry/Platforms/Native/sentry-native - key: sentry-native-macos-15-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} + key: sentry-native-macOS-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} fail-on-cache-miss: true - name: Setup Environment diff --git a/scripts/build-sentry-native.ps1 b/scripts/build-sentry-native.ps1 index d0137fcb14..901399033d 100644 --- a/scripts/build-sentry-native.ps1 +++ b/scripts/build-sentry-native.ps1 @@ -29,7 +29,7 @@ try if ("Arm64".Equals([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString())) { $outDir += '/win-arm64' - } + } else { $outDir += '/win-x64' From eab2490b32507f1da80789a1f9f5367c49be5161 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 21 May 2025 22:00:28 +0200 Subject: [PATCH 32/33] fix typos --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce890fc850..0ba10ace5e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,7 +135,7 @@ jobs: - name: Build id: build - run: dotnet build Sentry.CI-Build-${{ matrix.target || runner.os }} -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 }} -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' }} @@ -145,7 +145,7 @@ jobs: path: build.binlog - name: Test - 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" + 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 From 39937eb20d6258b67c5090b3c56c8f00752cb6af Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 21 May 2025 22:01:56 +0200 Subject: [PATCH 33/33] fix suffix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0ba10ace5e..d072f1fb6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,7 +135,7 @@ jobs: - name: Build id: build - run: dotnet build Sentry-CI-Build-${{ matrix.target || runner.os }} -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' }}