Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defaults:
jobs:
build:
name: Build - ${{ inputs.unity-version }}
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
permissions:
actions: read
checks: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-unity-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ on:

env:
# Unity versions used in PRs
PR_UNITY_VERSIONS: '["2021.3", "6000.5"]'
PR_UNITY_VERSIONS: '["2021.3", "6000.6"]'
# Unity versions used on main branch
FULL_UNITY_VERSIONS: '["2021.3", "2022.3", "6000.0", "6000.3", "6000.5"]'
FULL_UNITY_VERSIONS: '["2021.3", "2022.3", "6000.0", "6000.3", "6000.6"]'

jobs:
create-unity-matrix:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ jobs:
- name: Restore .NET Workload
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: dotnet workload restore

# javac 25 (default on ubuntu-26.04) warns on generated sources and sentry-native's ndk builds with -Werror.
- name: Setup Java
if: ${{ env.TARGET == 'Android' && steps.cache.outputs.cache-hit != 'true' }}
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: temurin
java-version: '17'

- name: Build
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/test-build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,8 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Load env
id: env
run: |
$u = (Get-Content scripts/unity-versions.json -Raw | ConvertFrom-Json).'${{ env.UNITY_VERSION }}'
"unityVersion=$($u.version)" >> $env:GITHUB_OUTPUT
"unityChangeset=$($u.changeset)" >> $env:GITHUB_OUTPUT

- name: Setup Unity
uses: getsentry/setup-unity@61c0c0944851685b6c1225e940d1b1ab349e3aa3
with:
unity-version: ${{ steps.env.outputs.unityVersion }}
unity-version-changeset: ${{ steps.env.outputs.unityChangeset }}
unity-modules: mac-il2cpp

- name: Create Unity license config
run: |
sudo mkdir -p "/Library/Application Support/Unity/config"
echo "$env:UNITY_LICENSE_SERVER_CONFIG" | sudo tee "/Library/Application Support/Unity/config/services-config.json" > /dev/null
run: ./scripts/setup-unity.ps1 -UnityVersion "${{ inputs.unity-version }}" -Modules mac-il2cpp
env:
UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}

Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/test-build-windows-mono.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,8 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Load env
id: env
run: |
$u = (Get-Content scripts/unity-versions.json -Raw | ConvertFrom-Json).'${{ env.UNITY_VERSION }}'
"unityVersion=$($u.version)" >> $env:GITHUB_OUTPUT
"unityChangeset=$($u.changeset)" >> $env:GITHUB_OUTPUT

- name: Setup Unity
uses: getsentry/setup-unity@61c0c0944851685b6c1225e940d1b1ab349e3aa3
with:
unity-version: ${{ steps.env.outputs.unityVersion }}
unity-version-changeset: ${{ steps.env.outputs.unityChangeset }}
unity-modules: windows-il2cpp

- name: Create Unity license config
run: |
New-Item -Path "C:/ProgramData/Unity/config/" -ItemType Directory -Force
Set-Content -Path "C:/ProgramData/Unity/config/services-config.json" -Value "$env:UNITY_LICENSE_SERVER_CONFIG"
run: ./scripts/setup-unity.ps1 -UnityVersion "${{ inputs.unity-version }}" -Modules windows-il2cpp
env:
UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}

Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/test-build-windows-x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,8 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Load env
id: env
run: |
$u = (Get-Content scripts/unity-versions.json -Raw | ConvertFrom-Json).'${{ env.UNITY_VERSION }}'
"unityVersion=$($u.version)" >> $env:GITHUB_OUTPUT
"unityChangeset=$($u.changeset)" >> $env:GITHUB_OUTPUT

- name: Setup Unity
uses: getsentry/setup-unity@61c0c0944851685b6c1225e940d1b1ab349e3aa3
with:
unity-version: ${{ steps.env.outputs.unityVersion }}
unity-version-changeset: ${{ steps.env.outputs.unityChangeset }}
unity-modules: windows-il2cpp

- name: Create Unity license config
run: |
New-Item -Path "C:/ProgramData/Unity/config/" -ItemType Directory -Force
Set-Content -Path "C:/ProgramData/Unity/config/services-config.json" -Value "$env:UNITY_LICENSE_SERVER_CONFIG"
run: ./scripts/setup-unity.ps1 -UnityVersion "${{ inputs.unity-version }}" -Modules windows-il2cpp
env:
UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}

Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/test-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,8 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Load env
id: env
run: |
$u = (Get-Content scripts/unity-versions.json -Raw | ConvertFrom-Json).'${{ env.UNITY_VERSION }}'
"unityVersion=$($u.version)" >> $env:GITHUB_OUTPUT
"unityChangeset=$($u.changeset)" >> $env:GITHUB_OUTPUT

- name: Setup Unity
uses: getsentry/setup-unity@61c0c0944851685b6c1225e940d1b1ab349e3aa3
with:
unity-version: ${{ steps.env.outputs.unityVersion }}
unity-version-changeset: ${{ steps.env.outputs.unityChangeset }}
unity-modules: windows-il2cpp

- name: Create Unity license config
run: |
New-Item -Path "C:/ProgramData/Unity/config/" -ItemType Directory -Force
Set-Content -Path "C:/ProgramData/Unity/config/services-config.json" -Value "$env:UNITY_LICENSE_SERVER_CONFIG"
run: ./scripts/setup-unity.ps1 -UnityVersion "${{ inputs.unity-version }}" -Modules windows-il2cpp
env:
UNITY_LICENSE_SERVER_CONFIG: ${{ secrets.UNITY_LICENSE_SERVER_CONFIG }}

Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test-run-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ jobs:
$PSNativeCommandUseErrorActionPreference = $true
$kernel = uname -r
sudo apt-get update
sudo apt-get install -y adb aapt "linux-modules-extra-$kernel"
sudo apt-get install -y adb aapt
# Kernels before 7.0 ship binder in linux-modules-extra; 7.0 ships it in linux-modules.
$PSNativeCommandUseErrorActionPreference = $false
modinfo binder_linux *> $null
$PSNativeCommandUseErrorActionPreference = $true
if ($LASTEXITCODE -ne 0) {
sudo apt-get install -y "linux-modules-extra-$kernel"
}
sudo modprobe binder_linux devices="binder,hwbinder,vndbinder"
$PSNativeCommandUseErrorActionPreference = $false
sudo modprobe ashmem_linux # built into the kernel on newer releases; ignore if absent
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
validate-pr:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Features

- Added support for Unity as a Library on iOS. With `IosNativeInitializationType` set to `NativeInitializationType.External`, the game attaches to the sentry-cocoa SDK that the app already started instead of bundling and starting its own. Native crashes carry the game's context and breadcrumbs, C# events and logs use the app's release, environment, and trace, the game's transactions join the app's trace, and debug symbols upload from the `UnityFramework` target. ([#2885](https://github.com/getsentry/sentry-unity/pull/2885))
- Added support for Unity as a Library on Android. With `AndroidNativeInitializationType` set to `NativeInitializationType.External`, the export ships no sentry-android and leaves the app's manifest alone. The game attaches to the sentry-android SDK the app started in the same process, or, when the game runs in its own process, starts it there with the options set in Unity and continues the app's trace. C# events use the app's release and environment. Debug symbols are uploaded when the app builds `unityLibrary`. ([#2885](https://github.com/getsentry/sentry-unity/pull/2885))

## 4.11.0

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Run integration tests locally using the same scripts as CI:

```pwsh
pwsh ./test/Scripts.Integration.Test/dev-integration-test.ps1 `
-UnityVersion "6000.5.0f1" `
-UnityVersion "6000.6.6f1" `
-Platform "MacOS" `
-Repack
```
Expand Down
6 changes: 3 additions & 3 deletions bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ else {
}

$localAssets = Join-Path $repoRoot "samples/unity-of-bugs-local/Assets"
if ((Test-Path $localAssets) -and (Get-Item $localAssets).LinkType -eq "SymbolicLink") {
Add-Result -Status "PASS" -Name "Local sample assets" -Detail "Assets symlink is available."
if ((Test-Path (Join-Path $localAssets "Scripts")) -and (Get-Item (Join-Path $localAssets "Scripts")).LinkType -eq "SymbolicLink") {
Add-Result -Status "PASS" -Name "Local sample assets" -Detail "Assets symlinks are available."
}
else {
Add-Result -Status "WARN" -Name "Local sample assets" -Detail "Assets symlink is unavailable." -Fix "Enable Git symlink support and restore samples/unity-of-bugs-local/Assets."
Add-Result -Status "WARN" -Name "Local sample assets" -Detail "Assets symlinks are unavailable." -Fix "Enable Git symlink support and restore samples/unity-of-bugs-local/Assets."
}

Write-Host ""
Expand Down
4 changes: 2 additions & 2 deletions docs/agent-guides/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

| Trigger | Integration Unity versions |
| --- | --- |
| Pull request | `2021.3`, `6000.5` |
| Main or non-PR | `2021.3`, `2022.3`, `6000.0`, `6000.3`, `6000.5` |
| Pull request | `2021.3`, `6000.6` |
| Main or non-PR | `2021.3`, `2022.3`, `6000.0`, `6000.3`, `6000.6` |
| `chore/unity-<major.minor>.*` PR | Matching version only |

Exact Unity editor versions and changesets live in `scripts/unity-versions.json`. The package build itself currently uses Unity `2021.3`.
Expand Down
1 change: 1 addition & 0 deletions docs/agent-guides/platform-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Runtime initialization writes `io.sentry.auto-init=false`; C# initializes the Java SDK later.
- Build-time initialization writes options to the Android manifest and lets Java auto-initialize.
- Runtime option changes cannot alter build-time initialization behavior.
- External initialization (Unity as a Library): the export ships no SDK, writes no manifest entries (they would merge into the app's), and keeps the ProGuard consumer rules. At runtime the game attaches if sentry-android is enabled in its process (no user, environment, or trace sync, no close, no NDK app-hang heartbeat). In a secondary process (e.g. `:Unity`), where the app didn't initialize it, the game initializes it from the Unity options with its own cache directory (`cache/sentry-<process>`), so it doesn't take over the main process's session and persisted scope. There it continues the main process's trace, read from that SDK's persisted scope (`cache/sentry/<dsn hash>/.scope-cache/trace.json`) at start and on resume, and turns off its own trace generation. The symbol upload task goes into `unityLibrary/build.gradle` and runs after `merge<Variant>JniLibFolders`, since the app never builds `launcher`. In the main process without an SDK, native support is skipped. Process detection needs API 28. C# sessions are off and the app's release and environment are used unless set.

## Export Processing

Expand Down
2 changes: 1 addition & 1 deletion docs/agent-guides/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dotnet msbuild /t:UnityEditModeTest test/Sentry.Unity.Editor.Tests

```pwsh
pwsh ./test/Scripts.Integration.Test/dev-integration-test.ps1 `
-UnityVersion "6000.5.0f1" `
-UnityVersion "6000.6.6f1" `
-Platform "MacOS" `
-Repack
```
Expand Down
1 change: 0 additions & 1 deletion samples/unity-of-bugs-local/Assets

This file was deleted.

1 change: 1 addition & 0 deletions samples/unity-of-bugs-local/Assets/Editor
1 change: 1 addition & 0 deletions samples/unity-of-bugs-local/Assets/Editor.meta
1 change: 1 addition & 0 deletions samples/unity-of-bugs-local/Assets/Plugins
1 change: 1 addition & 0 deletions samples/unity-of-bugs-local/Assets/Plugins.meta
1 change: 1 addition & 0 deletions samples/unity-of-bugs-local/Assets/Resources
1 change: 1 addition & 0 deletions samples/unity-of-bugs-local/Assets/Resources.meta
1 change: 1 addition & 0 deletions samples/unity-of-bugs-local/Assets/Scenes
1 change: 1 addition & 0 deletions samples/unity-of-bugs-local/Assets/Scenes.meta
1 change: 1 addition & 0 deletions samples/unity-of-bugs-local/Assets/Scripts
1 change: 1 addition & 0 deletions samples/unity-of-bugs-local/Assets/Scripts.meta
4 changes: 2 additions & 2 deletions samples/unity-of-bugs-local/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"dependencies": {
"com.unity.ai.navigation": "2.0.13",
"com.unity.burst": "2.0.0",
"com.unity.collab-proxy": "2.12.4",
"com.unity.collab-proxy": "2.13.6",
"com.unity.feature.development": "1.0.2",
"com.unity.ide.rider": "3.0.40",
"com.unity.ide.visualstudio": "2.0.26",
"com.unity.ide.vscode": "1.2.5",
"com.unity.mobile.android-logcat": "1.4.7",
"com.unity.multiplayer.center": "2.0.1",
"com.unity.pipeline": "0.4.0-exp.1",
"com.unity.pipeline": "0.9.0-exp.1",
"com.unity.test-framework": "1.8.0",
"com.unity.timeline": "6.6.0",
"com.unity.ugui": "2.6.0",
Expand Down
4 changes: 2 additions & 2 deletions samples/unity-of-bugs-local/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {}
},
"com.unity.collab-proxy": {
"version": "2.12.4",
"version": "2.13.6",
"depth": 0,
"source": "registry",
"dependencies": {},
Expand Down Expand Up @@ -109,7 +109,7 @@
"url": "https://packages.unity.com"
},
"com.unity.pipeline": {
"version": "0.4.0-exp.1",
"version": "0.9.0-exp.1",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 53
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 0}
m_Name:
m_EditorClassIdentifier: UnityEditor.ProjectAuditorModule:Unity.ProjectAuditor.Editor:ProjectAuditorSettings
Rules:
rules: []
DiagnosticParams:
paramsStack:
- PlatformGroup:
m_String: Unknown
m_SerializedParams:
- Key: StreamingClipThresholdBytes
Value: 218294
- Key: LongDecompressedClipThresholdBytes
Value: 204800
- Key: LongCompressedMobileClipThresholdBytes
Value: 204800
- Key: LoadInBackGroundClipSizeThresholdBytes
Value: 204800
- Key: TextureStreamingMipmapsSizeLimit
Value: 4000
- Key: SpriteAtlasEmptySpaceLimit
Value: 50
- Key: StreamingAssetsFolderSizeLimit
Value: 50
CurrentParamsIndex: 0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 6000.6.0b5
m_EditorVersionWithRevision: 6000.6.0b5 (b5238eaafb35)
m_EditorVersion: 6000.6.6f1
m_EditorVersionWithRevision: 6000.6.6f1 (d20c9ac777da)
8 changes: 5 additions & 3 deletions samples/unity-of-bugs-local/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Unity of Bugs (Local)

Unity 6 development project. Its `Assets` directory is a relative symlink to
`../unity-of-bugs/Assets`, so sample scenes and scripts stay shared with the
Unity 2021 compatibility project.
Unity 6 development project. The entries in its `Assets` directory are relative
symlinks into `../unity-of-bugs/Assets`, so sample scenes and scripts stay shared
with the Unity 2021 compatibility project. `Assets` itself is a real directory
because Unity Hub rejects projects whose `Assets` is a symlink. Add a symlink here
when adding a top-level folder to `unity-of-bugs/Assets`.

`Packages` and `ProjectSettings` are local to this project. Unity can upgrade
them without changing `unity-of-bugs`.
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-sample.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Wait-ForUnityPipelineBuild([string] $projectPath, [int] $timeoutSeconds

while ((Get-Date) -lt $deadline) {
try {
$status = Invoke-UnityPipelineCommand -ProjectPath $projectPath -Command "build_status"
$status = Invoke-UnityPipelineCommand -ProjectPath $projectPath -Command "build status"
}
catch {
$lastError = $_
Expand Down Expand Up @@ -88,7 +88,7 @@ function Wait-ForUnityPipelineBuild([string] $projectPath, [int] $timeoutSeconds
$executionMode = Get-UnityExecutionMode -ProjectPath $projectPath
if ($executionMode -eq "Pipeline") {
Prepare-UnityPipelineEditor -ProjectPath $projectPath -TimeoutSeconds $timeoutSeconds
$started = Invoke-UnityPipelineCommand -ProjectPath $projectPath -Command "build" -CommandArguments @("--target", $Target, "--outputPath", $outputPath, "--confirm", "true")
$started = Invoke-UnityPipelineCommand -ProjectPath $projectPath -Command "build run" -CommandArguments @("--target", $Target, "--outputPath", $outputPath, "--confirm", "true")
if ($started.status -ne "queued") {
$errorsProperty = $started.PSObject.Properties["validationErrors"]
$errors = if ($errorsProperty) { @($errorsProperty.Value) } else { @() }
Expand Down
1 change: 1 addition & 0 deletions scripts/ci-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ set -x
docker run -td --name $container \
--hostname $uniqueHostname \
--user $uid:$gid \
--shm-size=2g \
-v "$cwd":/sentry-unity \
-v $ANDROID_HOME:$ANDROID_HOME \
-v $JAVA_HOME_11_X64:$JAVA_HOME_11_X64 \
Expand Down
Loading
Loading