Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,24 @@ jobs:
name: Linux-sdk
path: package-dev/Plugins/Linux/Sentry~

- name: Download LinuxArm64 SDK
uses: ./.github/actions/wait-for-artifact
with:
name: LinuxArm64-sdk
path: package-dev/Plugins/Linux/Sentry~

- name: Download LinuxNative SDK
uses: ./.github/actions/wait-for-artifact
with:
name: LinuxNative-sdk
path: package-dev/Plugins/Linux/SentryNative~

- name: Download LinuxNativeArm64 SDK
uses: ./.github/actions/wait-for-artifact
with:
name: LinuxNativeArm64-sdk
path: package-dev/Plugins/Linux/SentryNative~

- name: Download Windows SDK
uses: ./.github/actions/wait-for-artifact
with:
Expand Down
41 changes: 39 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ jobs:
include:
- target: Android
host: ubuntu-latest
# 22.04 keeps the required glibc version low.
- target: Linux
host: ubuntu-latest
host: ubuntu-22.04
- target: LinuxNative
host: ubuntu-latest
host: ubuntu-22.04
- target: Linux
arch: Arm64
host: ubuntu-22.04-arm
- target: LinuxNative
arch: Arm64
host: ubuntu-22.04-arm
- target: Windows
host: windows-latest
- target: WindowsNative
Expand All @@ -54,6 +61,7 @@ jobs:
uses: ./.github/workflows/sdk.yml
with:
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
runsOn: ${{ matrix.host }}

build-unity-sdk:
Expand Down Expand Up @@ -448,6 +456,21 @@ jobs:
with:
unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version[0] }}

test-build-linux-arm64:
# Unity ships an arm64 Linux player only as an IL2CPP dedicated server, from 6000.3 on. One version,
# Native backend only: the x86_64 matrix already covers the version spread and Breakpad.
# The version is the newest matrix entry, so Unity-bump PRs for older versions skip it.
name: Build Linux Server arm64 ${{ needs.create-unity-matrix.outputs.unity-latest }} Integration Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') && fromJSON(needs.create-unity-matrix.outputs.unity-latest) >= 6000.3 }}
needs: [test-create, create-unity-matrix]
secrets:
UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_TEST_DSN: ${{ secrets.SENTRY_TEST_DSN }}
uses: ./.github/workflows/test-build-linux-arm64.yml
with:
unity-version: ${{ needs.create-unity-matrix.outputs.unity-latest }}

test-build-windows-mono:
# The Mono scripting backend resolves P/Invokes differently than IL2CPP, so it needs its own
# player. One version, default (Crashpad) backend only: the IL2CPP matrix already covers the
Expand Down Expand Up @@ -517,6 +540,20 @@ jobs:
platform: windows
backend: ${{ matrix.backend }}

test-run-linux-arm64:
name: Run Linux arm64 native ${{ needs.create-unity-matrix.outputs.unity-latest }} Integration Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') && fromJSON(needs.create-unity-matrix.outputs.unity-latest) >= 6000.3 }}
needs: [test-build-linux-arm64, create-unity-matrix]
secrets:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_TEST_DSN: ${{ secrets.SENTRY_TEST_DSN }}
uses: ./.github/workflows/test-run-desktop.yml
with:
unity-version: ${{ needs.create-unity-matrix.outputs.unity-latest }}
platform: linux
architecture: arm64
backend: native

test-run-windows-x86:
name: Run Windows x86 native ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version[0] }} Integration Test
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/create-unity-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
unity-matrix:
description: 'Unity version matrix'
value: ${{ jobs.create-unity-matrix.outputs.unity-matrix }}
unity-latest:
description: 'Newest Unity version in the matrix'
value: ${{ jobs.create-unity-matrix.outputs.unity-latest }}

env:
# Unity versions used in PRs
Expand All @@ -28,6 +31,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
unity-matrix: ${{ steps.set-matrix.outputs.matrix }}
unity-latest: ${{ steps.set-matrix.outputs.latest }}
steps:
- name: Set Unity version matrices based on event type
id: set-matrix
Expand All @@ -49,4 +53,5 @@ jobs:
fi

# Unity version matrix
echo "matrix={\"unity-version\":$versions}" >> $GITHUB_OUTPUT
echo "matrix={\"unity-version\":$versions}" >> $GITHUB_OUTPUT
echo "latest=$(jq -r '.[-1]' <<< "$versions")" >> $GITHUB_OUTPUT
11 changes: 8 additions & 3 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ on:
target:
required: true
type: string
arch:
required: false
type: string
default: ""

env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
TARGET: ${{ inputs.target }}
ARTIFACT: ${{ inputs.target }}${{ inputs.arch }}

jobs:
build:
Expand Down Expand Up @@ -63,7 +68,7 @@ jobs:
# hash of package/package.json for cache busting on release builds (version bump)
path: |
package-dev/Plugins
key: sdk=${{ env.TARGET }}-${{ hashFiles('submodules-status', 'package/package.json', 'Directory.Build.targets', 'build/native-sdks.targets', 'sdk-static/**', 'scripts/build-cocoa-sdk.ps1', 'scripts/build-native-ndk-local.ps1') }}
key: sdk=${{ env.ARTIFACT }}-${{ hashFiles('submodules-status', 'package/package.json', 'Directory.Build.targets', 'build/native-sdks.targets', 'sdk-static/**', 'scripts/build-cocoa-sdk.ps1', 'scripts/build-native-ndk-local.ps1') }}

- name: Installing Linux Dependencies
if: ${{ (env.TARGET == 'Linux' || env.TARGET == 'LinuxNative') && steps.cache.outputs.cache-hit != 'true' }}
Expand Down Expand Up @@ -143,15 +148,15 @@ jobs:
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ env.TARGET == 'Linux' }}
with:
name: ${{ env.TARGET }}-sdk
name: ${{ env.ARTIFACT }}-sdk
path: package-dev/Plugins/Linux/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 == 'LinuxNative' }}
with:
name: ${{ env.TARGET }}-sdk
name: ${{ env.ARTIFACT }}-sdk
path: package-dev/Plugins/Linux/SentryNative~
# Lower retention period - we only need this to retry CI.
retention-days: 14
Expand Down
133 changes: 133 additions & 0 deletions .github/workflows/test-build-linux-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: "Test: Build Linux Server arm64"
on:
workflow_call:
inputs:
unity-version:
required: true
type: string
secrets:
UNITY_LICENSE_SERVER_CONFIG:
required: true
SENTRY_AUTH_TOKEN:
required: true
SENTRY_TEST_DSN:
required: true

defaults:
run:
shell: pwsh

jobs:
build:
name: Linux Server arm64 ${{ inputs.unity-version }}
# Unity has no arm64 Linux editor and the GameCI images lack the arm64 server player, so this
# cross-compiles on x86_64 with the Unity CLI install instead. Pinned to 24.04: Unity's bundled
# IL2CPP linker needs libxml2.so.2, which 26.04 no longer ships.
runs-on: ubuntu-24.04
env:
UNITY_VERSION: ${{ inputs.unity-version }}
BUILD_PLATFORM: Linux-Server-arm64

steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Unity
run: ./scripts/setup-unity.ps1 -UnityVersion "${{ inputs.unity-version }}" -Modules linux-server
env:
UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}

- name: Download IntegrationTest project
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: test-${{ env.UNITY_VERSION }}

- name: Extract project archive
run: tar -xvzf test-project.tar.gz

- name: Restore Unity Library cache
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Library
key: it-library-linux-arm64-${{ env.UNITY_VERSION }}-${{ github.run_id }}
restore-keys: |
it-library-linux-arm64-${{ env.UNITY_VERSION }}-

- name: Download UPM package
uses: ./.github/actions/wait-for-artifact
with:
name: package-release

- name: Extract UPM package
run: ./test/Scripts.Integration.Test/extract-package.ps1

- name: Add Sentry to the project
run: ./test/Scripts.Integration.Test/add-sentry.ps1 -UnityPath "$env:UNITY_PATH" -PackagePath "test-package-release"

- name: Download DependencyConflict package
uses: ./.github/actions/wait-for-artifact
with:
name: dependency-conflict-package
path: dependency-conflict-package

- name: Add DependencyConflict to the project
run: ./test/Scripts.Integration.Test/add-dependency-conflict.ps1 -PackagePath "dependency-conflict-package"

- name: Configure Sentry
run: ./test/Scripts.Integration.Test/configure-sentry.ps1 -UnityPath "$env:UNITY_PATH" -Platform Linux
env:
SENTRY_DSN: ${{ secrets.SENTRY_TEST_DSN }}

- name: Use the Native backend
run: |
$optionsPath = "samples/IntegrationTest/Assets/Scripts/IntegrationOptionsConfiguration.cs"
$content = Get-Content $optionsPath -Raw
$content = $content -replace 'LinuxBackend = LinuxBackend.Breakpad', 'LinuxBackend = LinuxBackend.Native'
Set-Content $optionsPath $content

- name: Build with Sentry SDK
run: ./test/Scripts.Integration.Test/build-project.ps1 -UnityPath "$env:UNITY_PATH" -Platform Linux-Server-arm64 -UnityVersion "$env:UNITY_VERSION"
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

- name: Assert the player is arm64
run: |
$info = file samples/IntegrationTest/Build/test
Write-Host $info
if ($info -notmatch 'aarch64') { throw "Expected an arm64 player" }

- name: Assert symbols and sources were uploaded
run: ./test/Scripts.Integration.Test/assert-symbol-upload.ps1 -LogPath unity.log

# We create tar explicitly because upload-artifact is slow for many files.
- name: Create archive
run: |
Remove-Item -Recurse -Force samples/IntegrationTest/Build/*_BackUpThisFolder_ButDontShipItWithYourGame -ErrorAction SilentlyContinue
Copy-Item unity.log samples/IntegrationTest/Build/ -ErrorAction SilentlyContinue
tar -cvzf test-app-desktop.tar.gz samples/IntegrationTest/Build

- name: Upload test app
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: testapp-desktop-compiled-${{ env.UNITY_VERSION }}-linux-arm64-native
if-no-files-found: error
path: test-app-desktop.tar.gz
retention-days: 14

- name: Save Unity Library cache
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: samples/IntegrationTest/Library
key: it-library-linux-arm64-${{ env.UNITY_VERSION }}-${{ github.run_id }}

- name: Upload IntegrationTest project on failure
if: ${{ failure() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: failed-project-desktop-linux-arm64-${{ env.UNITY_VERSION }}
path: |
samples/IntegrationTest
unity.log
!samples/IntegrationTest/Build/*_BackUpThisFolder_ButDontShipItWithYourGame
retention-days: 14
7 changes: 4 additions & 3 deletions .github/workflows/test-run-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
required: false
type: string
default: ""
description: "Only set for non-default architectures, e.g. x86 for the 32-bit Windows player."
description: "Only set for non-default architectures, e.g. x86 for the 32-bit Windows player or arm64 for the Linux server."
scripting:
required: false
type: string
Expand All @@ -37,7 +37,7 @@ defaults:
jobs:
run:
name: ${{ inputs.platform }}${{ inputs.architecture && format(' {0}', inputs.architecture) || '' }}${{ inputs.scripting && format(' {0}', inputs.scripting) || '' }}${{ inputs.backend && format(' ({0})', inputs.backend) || '' }} ${{ inputs.unity-version }}
runs-on: ${{ inputs.platform == 'linux' && 'ubuntu-latest' || inputs.platform == 'macos' && 'macos-latest' || 'windows-latest' }}
runs-on: ${{ inputs.platform == 'linux' && (inputs.architecture == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest') || inputs.platform == 'macos' && 'macos-latest' || 'windows-latest' }}
env:
SENTRY_DSN: ${{ secrets.SENTRY_TEST_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
Expand Down Expand Up @@ -71,8 +71,9 @@ jobs:
- name: Run Integration Tests (Linux)
if: inputs.platform == 'linux'
timeout-minutes: 20
# The arm64 player is a headless dedicated server and needs no display.
run: |
xvfb-run pwsh -Command '
${{ inputs.architecture != 'arm64' && 'xvfb-run' || '' }} pwsh -Command '
$env:SENTRY_TEST_PLATFORM = "Desktop";
$env:SENTRY_TEST_APP = "samples/IntegrationTest/Build/test";
Invoke-Pester -Path test/IntegrationTest/Integration.Tests.ps1 -CI'
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@

### Fixes

- The Linux native SDK now loads on distros with older glibc versions, such as Ubuntu 22.04 and Debian 12. ([#2894](https://github.com/getsentry/sentry-unity/pull/2894))
- Attaching a screenshot no longer stalls the main thread. Unless `SetBeforeSendScreenshot` is set, the frame gets read back from the GPU asynchronously and encoded on a background thread. ([#2835](https://github.com/getsentry/sentry-unity/pull/2835))

### Features

- The SDK now supports Linux ARM64 dedicated servers (Unity 6000.3 and newer, IL2CPP). The native SDK for both backends ships for `x86_64` and `ARM64`, and the build picks the one matching the player. ([#2894](https://github.com/getsentry/sentry-unity/pull/2894))

### Dependencies

- Bump CLI from v3.8.0 to v3.8.2 ([#2893](https://github.com/getsentry/sentry-unity/pull/2893))
Expand Down
Loading
Loading