diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed0309e6d..37e6f050e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -108,7 +108,13 @@ jobs: uses: ./.github/actions/wait-for-artifact with: name: Windows-sdk - path: package-dev/Plugins/Windows + path: package-dev/Plugins/Windows/Sentry~ + + - name: Download WindowsNative SDK + uses: ./.github/actions/wait-for-artifact + with: + name: WindowsNative-sdk + path: package-dev/Plugins/Windows/SentryNative~ - name: Build Sentry.Unity Solution run: docker exec unity dotnet build -c Release -v:d diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cfee42fd..444426e26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,8 @@ jobs: host: ubuntu-latest - target: Windows host: windows-latest + - target: WindowsNative + host: windows-latest - target: Cocoa host: macos-latest - target: MacOSNative @@ -409,7 +411,7 @@ jobs: platform: linux test-run-windows: - name: Run Windows ${{ matrix.unity-version }} Integration Test + name: Run Windows ${{ matrix.backend }} ${{ matrix.unity-version }} Integration Test if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} needs: [test-build-windows, create-unity-matrix] secrets: inherit @@ -417,10 +419,12 @@ jobs: fail-fast: false matrix: unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} + backend: ["crashpad", "native"] uses: ./.github/workflows/test-run-desktop.yml with: unity-version: ${{ matrix.unity-version }} platform: windows + backend: ${{ matrix.backend }} test-run-macos: name: Run macOS ${{ matrix.backend }} ${{ matrix.unity-version }} Integration Test diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index e3819943b..8b63bd7a9 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -120,7 +120,23 @@ jobs: retention-days: 14 - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - if: ${{ env.TARGET != 'Cocoa' && env.TARGET != 'MacOSNative' }} + if: ${{ env.TARGET == 'Windows' }} + with: + name: ${{ env.TARGET }}-sdk + path: package-dev/Plugins/Windows/Sentry~ + # Lower retention period - we only need this to retry CI. + retention-days: 14 + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + if: ${{ env.TARGET == 'WindowsNative' }} + with: + name: ${{ env.TARGET }}-sdk + path: package-dev/Plugins/Windows/SentryNative~ + # Lower retention period - we only need this to retry CI. + retention-days: 14 + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + if: ${{ env.TARGET != 'Cocoa' && env.TARGET != 'MacOSNative' && env.TARGET != 'Windows' && env.TARGET != 'WindowsNative' }} with: name: ${{ env.TARGET }}-sdk path: package-dev/Plugins/${{ env.TARGET }} diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 8a66701f7..087388ce8 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -87,7 +87,7 @@ jobs: env: SENTRY_DSN: ${{ secrets.SENTRY_TEST_DSN }} - - name: Build with Sentry SDK + - name: Build with Sentry SDK (Crashpad backend) run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -Platform Windows -UnityVersion "$env:UNITY_VERSION" - name: Compare build sizes @@ -101,15 +101,39 @@ jobs: retention-days: 1 # We create tar explicitly because upload-artifact is slow for many files. - - name: Create archive + - name: Create archive (Crashpad backend) run: | Remove-Item -Recurse -Force samples/IntegrationTest/Build/*_BackUpThisFolder_ButDontShipItWithYourGame -ErrorAction SilentlyContinue tar -cvzf test-app-desktop.tar.gz samples/IntegrationTest/Build - - name: Upload test app + - name: Upload test app (Crashpad backend) uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: testapp-desktop-compiled-${{ env.UNITY_VERSION }}-windows + name: testapp-desktop-compiled-${{ env.UNITY_VERSION }}-windows-crashpad + if-no-files-found: error + path: test-app-desktop.tar.gz + retention-days: 14 + + - name: Overwrite IntegrationOptionsConfiguration for Native backend + run: | + $optionsPath = "samples/IntegrationTest/Assets/Scripts/IntegrationOptionsConfiguration.cs" + $content = Get-Content $optionsPath -Raw + $content = $content -replace 'WindowsBackend = WindowsBackend.Crashpad', 'WindowsBackend = WindowsBackend.Native' + Set-Content $optionsPath $content + + - name: Build with Sentry SDK (Native backend) + run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -Platform Windows -UnityVersion "$env:UNITY_VERSION" + + - name: Create archive (Native backend) + run: | + Remove-Item -Recurse -Force samples/IntegrationTest/Build/*_BackUpThisFolder_ButDontShipItWithYourGame -ErrorAction SilentlyContinue + Remove-Item -Force test-app-desktop.tar.gz -ErrorAction SilentlyContinue + tar -cvzf test-app-desktop.tar.gz samples/IntegrationTest/Build + + - name: Upload test app (Native backend) + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: testapp-desktop-compiled-${{ env.UNITY_VERSION }}-windows-native if-no-files-found: error path: test-app-desktop.tar.gz retention-days: 14 diff --git a/.github/workflows/test-run-desktop.yml b/.github/workflows/test-run-desktop.yml index 3f3a7be91..816324042 100644 --- a/.github/workflows/test-run-desktop.yml +++ b/.github/workflows/test-run-desktop.yml @@ -13,7 +13,7 @@ on: required: false type: string default: "" - description: "macOS only: native or cocoa" + description: "macOS: native or cocoa. Windows: native or crashpad." defaults: run: diff --git a/.gitignore b/.gitignore index 618d2ab2b..4eaaead10 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,10 @@ modules/sentry-native-ndk # Android SDK files package-dev/Plugins/Android/Sentry~/* +# Windows SDK files +package-dev/Plugins/Windows/Sentry~/* +package-dev/Plugins/Windows/SentryNative~/* + # CLI package-dev/Editor/sentry-cli diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a6f2c2f0..37759aef6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features -- Introduce `sentry-native` on macOS as experimental backend. This is an opt-in and accessible programmatically via the `options.Experimental`. The `sentry-native` backend allows for crashes to be sent immediately and will enable further updates, like `AppHangTracking` support ([#2687](https://github.com/getsentry/sentry-unity/pull/2687)) +- Introduce `sentry-native` as an experimental backend on macOS and Windows. Opt in via `options.Experimental.MacosBackend = MacosBackend.Native` or `options.Experimental.WindowsBackend = WindowsBackend.Native`. The `sentry-native` backend uploads crashes immediately and enables further updates such as `AppHangTracking` support ([#2687](https://github.com/getsentry/sentry-unity/pull/2687), [#2692](https://github.com/getsentry/sentry-unity/pull/2692)) ### Fixes diff --git a/build/native-sdks.targets b/build/native-sdks.targets index 01d91a264..dcdf9ba69 100644 --- a/build/native-sdks.targets +++ b/build/native-sdks.targets @@ -15,7 +15,8 @@ $(RepoRoot)modules/sentry-native/ $(SentryArtifactsDestination)Linux/Sentry/ - $(SentryArtifactsDestination)Windows/Sentry/ + $(SentryArtifactsDestination)Windows/Sentry~/ + $(SentryArtifactsDestination)Windows/SentryNative~/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +