From 24757b2ab52ea3a5fe2eef5f5b47e79bf54b388a Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Mon, 23 Mar 2026 15:53:55 +0100 Subject: [PATCH 1/8] cocoa as a submodule again --- .github/workflows/sdk.yml | 11 +-- .github/workflows/update-deps.yml | 2 +- .gitignore | 1 - .gitmodules | 3 + Directory.Build.targets | 15 ++- modules/sentry-cocoa | 1 + modules/sentry-cocoa.properties | 2 - scripts/build-cocoa-sdk.ps1 | 110 ++++++++++++++++++++++ scripts/download-native-sdks.ps1 | 39 ++++++-- scripts/setup-cocoa-sdk.ps1 | 147 ------------------------------ 10 files changed, 156 insertions(+), 175 deletions(-) create mode 160000 modules/sentry-cocoa delete mode 100644 modules/sentry-cocoa.properties create mode 100644 scripts/build-cocoa-sdk.ps1 delete mode 100644 scripts/setup-cocoa-sdk.ps1 diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index f25cc0535..eaae66213 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -28,16 +28,12 @@ jobs: if [[ "${TARGET}" == "Android" ]]; then submodules="modules/sentry-java" elif [[ "${TARGET}" == "Cocoa" ]]; then - submodules="" + submodules="modules/sentry-cocoa" else submodules="modules/sentry-native" fi echo "submodulesPath=$submodules" >> $GITHUB_OUTPUT - if [[ "$submodules" == "" ]]; then - echo "submodules=src/sentry-dotnet" >> $GITHUB_OUTPUT - else - echo "submodules=src/sentry-dotnet $submodules" >> $GITHUB_OUTPUT - fi + echo "submodules=src/sentry-dotnet $submodules" >> $GITHUB_OUTPUT - name: Get submodule status run: git submodule status --cached $SUBMODULES | tee submodules-status @@ -66,7 +62,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', 'sdk-static/**') }}${{ env.TARGET == 'Cocoa' && hashFiles('modules/sentry-cocoa.properties') || '' }} + key: sdk=${{ env.TARGET }}-${{ hashFiles('submodules-status', 'package/package.json', 'Directory.Build.targets', 'sdk-static/**') }} - name: Installing Linux Dependencies if: ${{ env.TARGET == 'Linux' && steps.cache.outputs.cache-hit != 'true' }} @@ -95,7 +91,6 @@ jobs: run: dotnet msbuild /t:Build${{ env.TARGET }}SDK /p:Configuration=Release /p:OutDir=other src/Sentry.Unity - name: Upload build logs on failure - # No build logs for Cocoa SDK as we assemble the xcframework from a downloaded release artifact if: ${{ failure() && env.TARGET != 'Cocoa' }} uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: diff --git a/.github/workflows/update-deps.yml b/.github/workflows/update-deps.yml index 47a66e751..29fbb1010 100644 --- a/.github/workflows/update-deps.yml +++ b/.github/workflows/update-deps.yml @@ -17,7 +17,7 @@ jobs: matrix: include: - name: Cocoa SDK - path: modules/sentry-cocoa.properties + path: modules/sentry-cocoa - name: Java SDK path: modules/sentry-java - name: Native SDK diff --git a/.gitignore b/.gitignore index 7eb5eab99..618d2ab2b 100644 --- a/.gitignore +++ b/.gitignore @@ -33,7 +33,6 @@ package-dev/Tests/Editor/TestFiles/ package-dev/Plugins/*/Sentry/crashpad_handler* # Download cache for native SDKs -modules/sentry-cocoa modules/sentry-native-ndk # Adding .meta to control target platforms for all of our DLLs diff --git a/.gitmodules b/.gitmodules index aaad81671..a9b426fac 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "modules/app-runner"] path = modules/app-runner url = https://github.com/getsentry/app-runner.git +[submodule "modules/sentry-cocoa"] + path = modules/sentry-cocoa + url = https://github.com/getsentry/sentry-cocoa.git diff --git a/Directory.Build.targets b/Directory.Build.targets index 9375f617a..ca40195e1 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -12,7 +12,7 @@ ../../artifacts/test/editmode/results.xml $(RepoRoot)package-dev/Plugins/ - $(RepoRoot)modules/sentry-cocoa/ + $(RepoRoot)modules/sentry-cocoa/ $(SentryArtifactsDestination)iOS/Sentry.xcframework~/ $(SentryArtifactsDestination)macOS/Sentry/ @@ -160,7 +160,7 @@ Expected to exist: - + @@ -190,20 +190,17 @@ Expected to exist: - + - - $([System.IO.File]::ReadAllText("$(RepoRoot)modules/sentry-cocoa.properties")) - $([System.Text.RegularExpressions.Regex]::Match($(PropertiesContent), 'version\s*=\s*([^\s]+)').Groups[1].Value) - + - + - + diff --git a/modules/sentry-cocoa b/modules/sentry-cocoa new file mode 160000 index 000000000..c63a66f1b --- /dev/null +++ b/modules/sentry-cocoa @@ -0,0 +1 @@ +Subproject commit c63a66f1b5107eec3792249bb03e65015eeba905 diff --git a/modules/sentry-cocoa.properties b/modules/sentry-cocoa.properties deleted file mode 100644 index 7f9724515..000000000 --- a/modules/sentry-cocoa.properties +++ /dev/null @@ -1,2 +0,0 @@ -version = 9.7.0 -repo = https://github.com/getsentry/sentry-cocoa diff --git a/scripts/build-cocoa-sdk.ps1 b/scripts/build-cocoa-sdk.ps1 new file mode 100644 index 000000000..8d36e3b4b --- /dev/null +++ b/scripts/build-cocoa-sdk.ps1 @@ -0,0 +1,110 @@ +#!/usr/bin/env pwsh + +param( + [Parameter(Mandatory = $true)] + [string]$CocoaRoot, + + [Parameter(Mandatory = $true)] + [string]$iOSDestination, + + [Parameter(Mandatory = $true)] + [string]$macOSDestination +) + +Set-StrictMode -Version latest +$ErrorActionPreference = 'Stop' +$PSNativeCommandUseErrorActionPreference = $true + +if (-not (Test-Path (Join-Path $CocoaRoot "Sentry.xcodeproj"))) { + Write-Error "sentry-cocoa submodule not checked out at: $CocoaRoot`nRun: git submodule update --init modules/sentry-cocoa" + exit 1 +} + +Write-Host "Building Cocoa SDK from source..." -ForegroundColor Yellow + +Push-Location $CocoaRoot +try { + ################ Build and set up iOS support ################ + + $iOSXcframeworkPath = Join-Path $CocoaRoot "Sentry-Dynamic-iOS.xcframework" + + if (-not (Test-Path $iOSXcframeworkPath)) { + Write-Host "Building iOS xcframework..." -ForegroundColor Yellow + & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "iOSOnly" "arm64e" + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to build iOS xcframework" + exit 1 + } + # build-xcframework-variant.sh produces Sentry-Dynamic.xcframework — rename to keep iOS and macOS separate + Move-Item -Path "Sentry-Dynamic.xcframework" -Destination $iOSXcframeworkPath -Force + if (Test-Path "XCFrameworkBuildPath/archive") { + Remove-Item -Path "XCFrameworkBuildPath/archive" -Recurse -Force + } + } + + Write-Host "Setting up iOS frameworks..." -ForegroundColor Yellow + + $iOSFrameworks = Get-ChildItem -Path $iOSXcframeworkPath -Directory | Where-Object { $_.Name -like "ios-*" -and $_.Name -notlike "*maccatalyst*" } + if ($iOSFrameworks.Count -eq 0) { + Write-Error "No iOS frameworks found in xcframework at: $iOSXcframeworkPath" + exit 1 + } + + if (Test-Path $iOSDestination) { + Remove-Item -Path $iOSDestination -Recurse -Force + } + Copy-Item -Path $iOSXcframeworkPath -Destination $iOSDestination -Recurse -Force + + $iOSInfoPlist = Join-Path $iOSDestination "Info.plist" + if (-not (Test-Path $iOSInfoPlist)) { + Write-Error "Failed to set up the iOS SDK." + exit 1 + } + Write-Host "iOS SDK set up at: $iOSDestination" -ForegroundColor Green + + ################ Build and set up macOS support ################ + + $macOSXcframeworkPath = Join-Path $CocoaRoot "Sentry-Dynamic-macOS.xcframework" + + if (-not (Test-Path $macOSXcframeworkPath)) { + Write-Host "Building macOS xcframework..." -ForegroundColor Yellow + & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "macOSOnly" "" + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to build macOS xcframework" + exit 1 + } + Move-Item -Path "Sentry-Dynamic.xcframework" -Destination $macOSXcframeworkPath -Force + if (Test-Path "XCFrameworkBuildPath") { + Remove-Item -Path "XCFrameworkBuildPath" -Recurse -Force + } + } + + Write-Host "Setting up macOS support..." -ForegroundColor Yellow + + $macOSFrameworkPath = Join-Path $macOSXcframeworkPath "macos-arm64_x86_64/Sentry.framework/Versions/A/Sentry" + $macOSdSYMPath = Join-Path $macOSXcframeworkPath "macos-arm64_x86_64/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry" + + $macOSDestDir = Split-Path $macOSDestination -Parent + if (-not (Test-Path $macOSDestDir)) { + New-Item -ItemType Directory -Path $macOSDestDir -Force | Out-Null + } + + if (-not (Test-Path $macOSFrameworkPath)) { + Write-Error "macOS framework not found at: $macOSFrameworkPath" + exit 1 + } + Copy-Item -Path $macOSFrameworkPath -Destination $macOSDestination -Force + Write-Host "Copied macOS dylib to: $macOSDestination" -ForegroundColor Green + + $macOSdSYMDestination = "$macOSDestination.dSYM" + if (-not (Test-Path $macOSdSYMPath)) { + Write-Error "macOS dSYM not found at: $macOSdSYMPath" + exit 1 + } + Copy-Item -Path $macOSdSYMPath -Destination $macOSdSYMDestination -Force + Write-Host "Copied macOS dSYM to: $macOSdSYMDestination" -ForegroundColor Green +} finally { + Pop-Location +} + +Write-Host "Cocoa SDK build completed successfully!" -ForegroundColor Green diff --git a/scripts/download-native-sdks.ps1 b/scripts/download-native-sdks.ps1 index 63c3b9588..6d6853881 100644 --- a/scripts/download-native-sdks.ps1 +++ b/scripts/download-native-sdks.ps1 @@ -28,13 +28,30 @@ $SDKs = @( Destination = Join-Path $ArtifactsDestination "Android" CheckDir = "Sentry~" ExpectedFileCount = 4 + }, + @{ + Name = "Cocoa" + Destination = $ArtifactsDestination + CheckFiles = @( + "iOS/Sentry.xcframework~/Info.plist", + "macOS/Sentry/Sentry.dylib" + ) } ) function Test-SDKPresent { param($SDK) - if ($SDK.ContainsKey('CheckFile')) { + if ($SDK.ContainsKey('CheckFiles')) { + foreach ($file in $SDK.CheckFiles) { + $checkPath = Join-Path $SDK.Destination $file + if (-not (Test-Path $checkPath)) { + return $false + } + } + return $true + } + elseif ($SDK.ContainsKey('CheckFile')) { $checkPath = Join-Path $SDK.Destination $SDK.CheckFile return Test-Path $checkPath } @@ -75,20 +92,28 @@ function Download-SDK { Write-Host "Downloading $Name SDK..." -ForegroundColor Yellow - # Remove existing directory if present (partial download) - if (Test-Path $Destination) { - Write-Host " Removing existing directory..." -ForegroundColor Gray - Remove-Item -Path $Destination -Recurse -Force + $artifactName = "$Name-sdk" + + # Download to a temp directory, then move contents into destination + $tempDir = Join-Path ([System.IO.Path]::GetTempPath()) "sentry-$Name-sdk-download" + if (Test-Path $tempDir) { + Remove-Item -Path $tempDir -Recurse -Force } - $artifactName = "$Name-sdk" - gh run download $RunId -n $artifactName -D $Destination + gh run download $RunId -n $artifactName -D $tempDir if ($LASTEXITCODE -ne 0) { Write-Error "Failed to download $Name SDK" exit 1 } + # Move downloaded contents into the destination + if (-not (Test-Path $Destination)) { + New-Item -ItemType Directory -Path $Destination -Force | Out-Null + } + Copy-Item -Path (Join-Path $tempDir "*") -Destination $Destination -Recurse -Force + Remove-Item -Path $tempDir -Recurse -Force -ErrorAction SilentlyContinue + Write-Host " Downloaded $Name SDK successfully" -ForegroundColor Green } diff --git a/scripts/setup-cocoa-sdk.ps1 b/scripts/setup-cocoa-sdk.ps1 deleted file mode 100644 index 3e75c2d50..000000000 --- a/scripts/setup-cocoa-sdk.ps1 +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env pwsh - -param( - [Parameter(Mandatory=$true)] - [string]$RepoRoot, - - [Parameter(Mandatory=$true)] - [string]$CocoaVersion, - - [Parameter(Mandatory=$true)] - [string]$CocoaCache, - - [Parameter(Mandatory=$true)] - [string]$iOSDestination, - - [Parameter(Mandatory=$true)] - [string]$macOSDestination, - - [switch]$iOSOnly -) - -Set-StrictMode -Version latest -$ErrorActionPreference = 'Stop' -$PSNativeCommandUseErrorActionPreference = $true - -# Clean cache if version does not exist to get rid of old versions -$zipFile = Join-Path $CocoaCache "Sentry-Dynamic-$CocoaVersion.xcframework.zip" -if (-not (Test-Path $zipFile)) { - Write-Host "Cleaning cache directory for new version..." -ForegroundColor Yellow - if (Test-Path $CocoaCache) { - Remove-Item -Path $CocoaCache -Recurse -Force - } -} - -if (-not (Test-Path $CocoaCache)) { - New-Item -ItemType Directory -Path $CocoaCache -Force | Out-Null -} - -if (-not (Test-Path $zipFile)) { - Write-Host "Downloading Cocoa SDK version '$CocoaVersion'..." -ForegroundColor Yellow - $downloadUrl = "https://github.com/getsentry/sentry-cocoa/releases/download/$CocoaVersion/Sentry-Dynamic.xcframework.zip" - Invoke-WebRequest -Uri $downloadUrl -OutFile $zipFile -} - -$xcframeworkPath = Join-Path $CocoaCache "Sentry-Dynamic.xcframework" -if (-not (Test-Path $xcframeworkPath)) { - Write-Host "Extracting xcframework..." -ForegroundColor Yellow - Expand-Archive -Path $zipFile -DestinationPath $CocoaCache -Force -} - -################ Set up iOS support ################ -# We strip out the iOS frameworks and create a new xcframework out of those. - -Write-Host "Setting up iOS frameworks..." -ForegroundColor Yellow - -$iOSFrameworks = Get-ChildItem -Path $xcframeworkPath -Directory | Where-Object { $_.Name -like "ios-*" -and $_.Name -notlike "*maccatalyst*" } -if ($iOSFrameworks.Count -eq 0) { - Write-Error "No iOS frameworks found in xcframework at: $xcframeworkPath" - exit 1 -} - -Write-Host "Found $($iOSFrameworks.Count) iOS frameworks:" -ForegroundColor Green -foreach ($framework in $iOSFrameworks) { - Write-Host " - $($framework.Name)" -ForegroundColor Cyan -} - -$xcodebuildArgs = @("-create-xcframework") - -foreach ($framework in $iOSFrameworks) { - $frameworkPath = Join-Path $framework.FullName "Sentry.framework" - if (Test-Path $frameworkPath) { - $xcodebuildArgs += "-framework" - $xcodebuildArgs += $frameworkPath - Write-Host "Adding framework: $frameworkPath" -ForegroundColor Cyan - } else { - Write-Warning "Framework not found at: $frameworkPath" - } -} - -# Remove the ~ suffix from destination. xcodebuild requires the output path to end with `.xcframework` -$xcframeworkDestination = $iOSDestination.TrimEnd('~', '/') - -$xcodebuildArgs += "-output" -$xcodebuildArgs += $xcframeworkDestination - -Write-Host "Creating iOS-only xcframework..." -ForegroundColor Yellow -Write-Host "Command: xcodebuild $($xcodebuildArgs -join ' ')" -ForegroundColor Gray - -try { - & xcodebuild @xcodebuildArgs - if ($LASTEXITCODE -ne 0) { - Write-Error "xcodebuild failed with exit code: $LASTEXITCODE" - exit 1 - } - Write-Host "Successfully created iOS-only xcframework at: $xcframeworkDestination" -ForegroundColor Green -} catch { - Write-Error "Failed to run xcodebuild: $($_.Exception.Message)" - exit 1 -} - -Write-Host "Appending '~' for Unity to ignore the framework" -Move-Item -Path $xcframeworkDestination -Destination $iOSDestination -Force - -$iOSInfoPlist = Join-Path $iOSDestination "Info.plist" -if (-not (Test-Path $iOSDestination) -or -not (Test-Path $iOSInfoPlist)) { - Write-Error "Failed to set up the iOS SDK." - exit 1 -} - -################ Set up macOS support ################ -# We copy the .dylib and the .dSYM directly into the plugins folder - -if (-not $iOSOnly) { - Write-Host "Setting up macOS support..." -ForegroundColor Yellow - - $macOSFrameworkPath = Join-Path $xcframeworkPath "macos-arm64_x86_64/Sentry.framework/Versions/A/Sentry" - $macOSdSYMPath = Join-Path $xcframeworkPath "macos-arm64_x86_64/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry" - - $macOSDestDir = Split-Path $macOSDestination -Parent - if (-not (Test-Path $macOSDestDir)) { - New-Item -ItemType Directory -Path $macOSDestDir -Force | Out-Null - } - - if (Test-Path $macOSFrameworkPath) { - Copy-Item -Path $macOSFrameworkPath -Destination $macOSDestination -Force - Write-Host "Copied macOS dylib to: $macOSDestination" -ForegroundColor Green - } else { - Write-Error "macOS framework not found at: $macOSFrameworkPath" - exit 1 - } - - $macOSdSYMDestination = "$macOSDestination.dSYM" - if (Test-Path $macOSdSYMPath) { - Copy-Item -Path $macOSdSYMPath -Destination $macOSdSYMDestination -Force - Write-Host "Copied macOS dSYM to: $macOSdSYMDestination" -ForegroundColor Green - } else { - Write-Error "macOS dSYM not found at: $macOSdSYMPath" - exit 1 - } - - if (-not (Test-Path $macOSDestination) -or -not (Test-Path $macOSdSYMDestination)) { - Write-Error "Failed to set up the macOS SDK." - exit 1 - } -} - -Write-Host "Cocoa SDK setup completed successfully!" -ForegroundColor Green \ No newline at end of file From 31a6d8254883248c934a6d2f6ab42094cdf49004 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Mon, 23 Mar 2026 16:00:20 +0100 Subject: [PATCH 2/8] don't specialcase arm64e --- scripts/build-cocoa-sdk.ps1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/build-cocoa-sdk.ps1 b/scripts/build-cocoa-sdk.ps1 index 8d36e3b4b..3df39643c 100644 --- a/scripts/build-cocoa-sdk.ps1 +++ b/scripts/build-cocoa-sdk.ps1 @@ -30,7 +30,7 @@ try { if (-not (Test-Path $iOSXcframeworkPath)) { Write-Host "Building iOS xcframework..." -ForegroundColor Yellow - & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "iOSOnly" "arm64e" + & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "iOSOnly" "" if ($LASTEXITCODE -ne 0) { Write-Error "Failed to build iOS xcframework" exit 1 @@ -81,8 +81,13 @@ try { Write-Host "Setting up macOS support..." -ForegroundColor Yellow - $macOSFrameworkPath = Join-Path $macOSXcframeworkPath "macos-arm64_x86_64/Sentry.framework/Versions/A/Sentry" - $macOSdSYMPath = Join-Path $macOSXcframeworkPath "macos-arm64_x86_64/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry" + $macOSSlice = Get-ChildItem -Path $macOSXcframeworkPath -Directory | Where-Object { $_.Name -like "macos-*" } | Select-Object -First 1 + if (-not $macOSSlice) { + Write-Error "No macOS slice found in xcframework at: $macOSXcframeworkPath" + exit 1 + } + $macOSFrameworkPath = Join-Path $macOSSlice.FullName "Sentry.framework/Versions/A/Sentry" + $macOSdSYMPath = Join-Path $macOSSlice.FullName "dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry" $macOSDestDir = Split-Path $macOSDestination -Parent if (-not (Test-Path $macOSDestDir)) { From 19e2835a9f053a0fdc29afb2e36fe7e19e777587 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Tue, 24 Mar 2026 14:14:44 +0100 Subject: [PATCH 3/8] Exclude arm64e and strip dSYMs from iOS xcframework --- scripts/build-cocoa-sdk.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/build-cocoa-sdk.ps1 b/scripts/build-cocoa-sdk.ps1 index 3df39643c..f4ab4eca2 100644 --- a/scripts/build-cocoa-sdk.ps1 +++ b/scripts/build-cocoa-sdk.ps1 @@ -30,7 +30,7 @@ try { if (-not (Test-Path $iOSXcframeworkPath)) { Write-Host "Building iOS xcframework..." -ForegroundColor Yellow - & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "iOSOnly" "" + & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "iOSOnly" "arm64e" if ($LASTEXITCODE -ne 0) { Write-Error "Failed to build iOS xcframework" exit 1 @@ -55,6 +55,9 @@ try { } Copy-Item -Path $iOSXcframeworkPath -Destination $iOSDestination -Recurse -Force + # Remove dSYMs from the iOS xcframework - they bloat the package and debug symbols are uploaded separately via sentry-cli + Get-ChildItem -Path $iOSDestination -Directory -Recurse -Filter "dSYMs" | Remove-Item -Recurse -Force + $iOSInfoPlist = Join-Path $iOSDestination "Info.plist" if (-not (Test-Path $iOSInfoPlist)) { Write-Error "Failed to set up the iOS SDK." From b64bacd495403bfceb233bbb28c5f996843dd0a9 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Tue, 24 Mar 2026 15:00:47 +0100 Subject: [PATCH 4/8] Reassemble iOS xcframework without dSYMs to fix Xcode build --- scripts/build-cocoa-sdk.ps1 | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/scripts/build-cocoa-sdk.ps1 b/scripts/build-cocoa-sdk.ps1 index f4ab4eca2..fd6e75bb3 100644 --- a/scripts/build-cocoa-sdk.ps1 +++ b/scripts/build-cocoa-sdk.ps1 @@ -50,13 +50,39 @@ try { exit 1 } + # Reassemble the xcframework from just the framework slices (without dSYMs). + # The build produces an xcframework with dSYMs bundled and referenced in its Info.plist. + # Shipping those would bloat the package and Xcode validates the Info.plist references, + # so we create a clean xcframework with only -framework arguments. + $xcodebuildArgs = @("-create-xcframework") + foreach ($framework in $iOSFrameworks) { + $frameworkPath = Join-Path $framework.FullName "Sentry.framework" + if (Test-Path $frameworkPath) { + $xcodebuildArgs += "-framework" + $xcodebuildArgs += $frameworkPath + } + } + + # Remove the ~ suffix from destination - xcodebuild requires the output path to end with `.xcframework` + $xcframeworkOutput = $iOSDestination.TrimEnd('~', '/') + if (Test-Path $xcframeworkOutput) { + Remove-Item -Path $xcframeworkOutput -Recurse -Force + } if (Test-Path $iOSDestination) { Remove-Item -Path $iOSDestination -Recurse -Force } - Copy-Item -Path $iOSXcframeworkPath -Destination $iOSDestination -Recurse -Force - # Remove dSYMs from the iOS xcframework - they bloat the package and debug symbols are uploaded separately via sentry-cli - Get-ChildItem -Path $iOSDestination -Directory -Recurse -Filter "dSYMs" | Remove-Item -Recurse -Force + $xcodebuildArgs += "-output" + $xcodebuildArgs += $xcframeworkOutput + + & xcodebuild $xcodebuildArgs + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to create iOS xcframework" + exit 1 + } + + # Append '~' so Unity ignores the framework during import + Move-Item -Path $xcframeworkOutput -Destination $iOSDestination -Force $iOSInfoPlist = Join-Path $iOSDestination "Info.plist" if (-not (Test-Path $iOSInfoPlist)) { From 8ecaf2725d217e6b12f724a8dd9ba3a4f7313fef Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Tue, 24 Mar 2026 15:09:20 +0100 Subject: [PATCH 5/8] Include iOS dSYMs in package for symbolication --- scripts/build-cocoa-sdk.ps1 | 39 ++----------------- .../package-release.zip.snapshot | 19 +++++++-- 2 files changed, 19 insertions(+), 39 deletions(-) diff --git a/scripts/build-cocoa-sdk.ps1 b/scripts/build-cocoa-sdk.ps1 index fd6e75bb3..769ba8745 100644 --- a/scripts/build-cocoa-sdk.ps1 +++ b/scripts/build-cocoa-sdk.ps1 @@ -44,45 +44,14 @@ try { Write-Host "Setting up iOS frameworks..." -ForegroundColor Yellow - $iOSFrameworks = Get-ChildItem -Path $iOSXcframeworkPath -Directory | Where-Object { $_.Name -like "ios-*" -and $_.Name -notlike "*maccatalyst*" } - if ($iOSFrameworks.Count -eq 0) { - Write-Error "No iOS frameworks found in xcframework at: $iOSXcframeworkPath" - exit 1 - } - - # Reassemble the xcframework from just the framework slices (without dSYMs). - # The build produces an xcframework with dSYMs bundled and referenced in its Info.plist. - # Shipping those would bloat the package and Xcode validates the Info.plist references, - # so we create a clean xcframework with only -framework arguments. - $xcodebuildArgs = @("-create-xcframework") - foreach ($framework in $iOSFrameworks) { - $frameworkPath = Join-Path $framework.FullName "Sentry.framework" - if (Test-Path $frameworkPath) { - $xcodebuildArgs += "-framework" - $xcodebuildArgs += $frameworkPath - } - } - - # Remove the ~ suffix from destination - xcodebuild requires the output path to end with `.xcframework` - $xcframeworkOutput = $iOSDestination.TrimEnd('~', '/') - if (Test-Path $xcframeworkOutput) { - Remove-Item -Path $xcframeworkOutput -Recurse -Force - } if (Test-Path $iOSDestination) { Remove-Item -Path $iOSDestination -Recurse -Force } - $xcodebuildArgs += "-output" - $xcodebuildArgs += $xcframeworkOutput - - & xcodebuild $xcodebuildArgs - if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to create iOS xcframework" - exit 1 - } - - # Append '~' so Unity ignores the framework during import - Move-Item -Path $xcframeworkOutput -Destination $iOSDestination -Force + # Copy the xcframework as-is, including dSYMs. Since we build from source, the debug symbols + # won't be on Sentry's symbol server — they need to ship in the package so the Xcode build phase + # can upload them via sentry-cli, consistent with how all other native SDKs ship their debug symbols. + Copy-Item -Path $iOSXcframeworkPath -Destination $iOSDestination -Recurse -Force $iOSInfoPlist = Join-Path $iOSDestination "Info.plist" if (-not (Test-Path $iOSInfoPlist)) { diff --git a/test/Scripts.Tests/package-release.zip.snapshot b/test/Scripts.Tests/package-release.zip.snapshot index 0fc135018..7c3dd8ba7 100644 --- a/test/Scripts.Tests/package-release.zip.snapshot +++ b/test/Scripts.Tests/package-release.zip.snapshot @@ -50,7 +50,9 @@ Plugins/iOS/SentryNativeBridge.m.meta Plugins/iOS/SentryNativeBridgeNoOp.m Plugins/iOS/SentryNativeBridgeNoOp.m.meta Plugins/iOS/Sentry.xcframework~/ios-arm64/ +Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/ Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/ +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/ Plugins/iOS/Sentry.xcframework~/Info.plist Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/Sentry.framework/Info.plist Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/Sentry.framework/PrivacyInfo.xcprivacy @@ -191,10 +193,19 @@ Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftm Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.private.swiftinterface Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.swiftdoc Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.swiftinterface -Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.abi.json -Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.private.swiftinterface -Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.swiftdoc -Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.swiftinterface +Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/ +Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/ +Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Info.plist +Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/ +Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/aarch64/Sentry.yml +Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/ +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/ +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Info.plist +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/ +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/aarch64/Sentry.yml +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/x86_64/Sentry.yml +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry Plugins/Linux/Sentry.meta Plugins/Linux/Sentry/libsentry.dbg.so Plugins/Linux/Sentry/libsentry.dbg.so.meta From b005aedca2826d289584d7288b3cc429d98ba253 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Tue, 24 Mar 2026 16:38:50 +0100 Subject: [PATCH 6/8] exlude arm64e --- scripts/build-cocoa-sdk.ps1 | 16 ++++++++++++---- .../Scripts.Tests/package-release.zip.snapshot | 18 +++++++++--------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/scripts/build-cocoa-sdk.ps1 b/scripts/build-cocoa-sdk.ps1 index 769ba8745..e1b67d943 100644 --- a/scripts/build-cocoa-sdk.ps1 +++ b/scripts/build-cocoa-sdk.ps1 @@ -30,10 +30,18 @@ try { if (-not (Test-Path $iOSXcframeworkPath)) { Write-Host "Building iOS xcframework..." -ForegroundColor Yellow - & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "iOSOnly" "arm64e" - if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to build iOS xcframework" - exit 1 + # Exclude arm64e: inject EXCLUDED_ARCHS via xcconfig so xcodebuild never builds it. + # We can't modify the submodule's xcodebuild calls directly, but xcodebuild respects + # the XCODE_XCCONFIG_FILE environment variable for additional build settings. + $xcconfig = Join-Path $CocoaRoot "sentry-unity.xcconfig" + "EXCLUDED_ARCHS = arm64e" | Set-Content $xcconfig + $env:XCODE_XCCONFIG_FILE = $xcconfig + try { + & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "iOSOnly" + } + finally { + $env:XCODE_XCCONFIG_FILE = $null + Remove-Item $xcconfig -ErrorAction SilentlyContinue } # build-xcframework-variant.sh produces Sentry-Dynamic.xcframework — rename to keep iOS and macOS separate Move-Item -Path "Sentry-Dynamic.xcframework" -Destination $iOSXcframeworkPath -Force diff --git a/test/Scripts.Tests/package-release.zip.snapshot b/test/Scripts.Tests/package-release.zip.snapshot index 7c3dd8ba7..e60adf77e 100644 --- a/test/Scripts.Tests/package-release.zip.snapshot +++ b/test/Scripts.Tests/package-release.zip.snapshot @@ -50,10 +50,9 @@ Plugins/iOS/SentryNativeBridge.m.meta Plugins/iOS/SentryNativeBridgeNoOp.m Plugins/iOS/SentryNativeBridgeNoOp.m.meta Plugins/iOS/Sentry.xcframework~/ios-arm64/ -Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/ Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/ -Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/ Plugins/iOS/Sentry.xcframework~/Info.plist +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/ Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/Sentry.framework/Info.plist Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/Sentry.framework/PrivacyInfo.xcprivacy Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/Sentry.framework/Sentry @@ -126,6 +125,14 @@ Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/Sentry.framework/Modu Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/Sentry.framework/Modules/Sentry.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/Sentry.framework/Modules/Sentry.swiftmodule/x86_64-apple-ios-simulator.swiftdoc Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/Sentry.framework/Modules/Sentry.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/ +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/ +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Info.plist +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/ +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/aarch64/Sentry.yml +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/x86_64/Sentry.yml +Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry +Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/ Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Info.plist Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/PrivacyInfo.xcprivacy Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Sentry @@ -199,13 +206,6 @@ Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/I Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/ Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/aarch64/Sentry.yml Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry -Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/ -Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/ -Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Info.plist -Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/ -Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/aarch64/Sentry.yml -Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/x86_64/Sentry.yml -Plugins/iOS/Sentry.xcframework~/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry Plugins/Linux/Sentry.meta Plugins/Linux/Sentry/libsentry.dbg.so Plugins/Linux/Sentry/libsentry.dbg.so.meta From 81a4568c5428dccb2ce82b1f4963d5a4973f7f6d Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 25 Mar 2026 11:51:48 +0100 Subject: [PATCH 7/8] updated snapshot --- .github/workflows/sdk.yml | 8 ++-- Directory.Build.targets | 2 + scripts/build-cocoa-sdk.ps1 | 44 +++++++------------ .../package-release.zip.snapshot | 5 +++ 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index eaae66213..5788728f3 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -62,7 +62,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', 'sdk-static/**') }} + key: sdk=${{ env.TARGET }}-${{ hashFiles('submodules-status', 'package/package.json', 'Directory.Build.targets', 'sdk-static/**', 'scripts/build-cocoa-sdk.ps1') }} - name: Installing Linux Dependencies if: ${{ env.TARGET == 'Linux' && steps.cache.outputs.cache-hit != 'true' }} @@ -91,10 +91,12 @@ jobs: run: dotnet msbuild /t:Build${{ env.TARGET }}SDK /p:Configuration=Release /p:OutDir=other src/Sentry.Unity - name: Upload build logs on failure - if: ${{ failure() && env.TARGET != 'Cocoa' }} + if: ${{ failure() }} uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: - path: ${{ steps.env.outputs.submodulesPath }}/build.log + path: | + ${{ steps.env.outputs.submodulesPath }}/build.log + modules/sentry-cocoa/*.log # Lower retention period - we only need this to retry CI. retention-days: 14 diff --git a/Directory.Build.targets b/Directory.Build.targets index ca40195e1..e5b93b5b5 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -161,6 +161,8 @@ Expected to exist: + + diff --git a/scripts/build-cocoa-sdk.ps1 b/scripts/build-cocoa-sdk.ps1 index e1b67d943..8ea3f758f 100644 --- a/scripts/build-cocoa-sdk.ps1 +++ b/scripts/build-cocoa-sdk.ps1 @@ -20,34 +20,27 @@ if (-not (Test-Path (Join-Path $CocoaRoot "Sentry.xcodeproj"))) { exit 1 } +# Build intermediates are stored inside the submodule directory. Clean them to avoid stale builds +# when the submodule is updated to a new version. +$buildPath = Join-Path $CocoaRoot "XCFrameworkBuildPath" +$iOSXcframeworkPath = Join-Path $CocoaRoot "Sentry-Dynamic-iOS.xcframework" +$macOSXcframeworkPath = Join-Path $CocoaRoot "Sentry-Dynamic-macOS.xcframework" + Write-Host "Building Cocoa SDK from source..." -ForegroundColor Yellow Push-Location $CocoaRoot try { ################ Build and set up iOS support ################ - $iOSXcframeworkPath = Join-Path $CocoaRoot "Sentry-Dynamic-iOS.xcframework" - if (-not (Test-Path $iOSXcframeworkPath)) { Write-Host "Building iOS xcframework..." -ForegroundColor Yellow - # Exclude arm64e: inject EXCLUDED_ARCHS via xcconfig so xcodebuild never builds it. - # We can't modify the submodule's xcodebuild calls directly, but xcodebuild respects - # the XCODE_XCCONFIG_FILE environment variable for additional build settings. - $xcconfig = Join-Path $CocoaRoot "sentry-unity.xcconfig" - "EXCLUDED_ARCHS = arm64e" | Set-Content $xcconfig - $env:XCODE_XCCONFIG_FILE = $xcconfig - try { - & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "iOSOnly" - } - finally { - $env:XCODE_XCCONFIG_FILE = $null - Remove-Item $xcconfig -ErrorAction SilentlyContinue - } + # Exclude arm64e from the binary. Since Xcode 26, apps without arm64e in the main binary + # can't include frameworks with arm64e slices (App Store rejection). The sentry-cocoa SDK + # ships separate "-WithARM64e" variants for apps that need it; Unity games don't. + & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "iOSOnly" "arm64e" + & ./scripts/validate-xcframework-format.sh "Sentry-Dynamic.xcframework" # build-xcframework-variant.sh produces Sentry-Dynamic.xcframework — rename to keep iOS and macOS separate Move-Item -Path "Sentry-Dynamic.xcframework" -Destination $iOSXcframeworkPath -Force - if (Test-Path "XCFrameworkBuildPath/archive") { - Remove-Item -Path "XCFrameworkBuildPath/archive" -Recurse -Force - } } Write-Host "Setting up iOS frameworks..." -ForegroundColor Yellow @@ -70,19 +63,16 @@ try { ################ Build and set up macOS support ################ - $macOSXcframeworkPath = Join-Path $CocoaRoot "Sentry-Dynamic-macOS.xcframework" - if (-not (Test-Path $macOSXcframeworkPath)) { Write-Host "Building macOS xcframework..." -ForegroundColor Yellow & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "macOSOnly" "" - if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to build macOS xcframework" - exit 1 - } + & ./scripts/validate-xcframework-format.sh "Sentry-Dynamic.xcframework" Move-Item -Path "Sentry-Dynamic.xcframework" -Destination $macOSXcframeworkPath -Force - if (Test-Path "XCFrameworkBuildPath") { - Remove-Item -Path "XCFrameworkBuildPath" -Recurse -Force - } + } + + # Clean up build intermediates after both builds complete + if (Test-Path $buildPath) { + Remove-Item -Path $buildPath -Recurse -Force } Write-Host "Setting up macOS support..." -ForegroundColor Yellow diff --git a/test/Scripts.Tests/package-release.zip.snapshot b/test/Scripts.Tests/package-release.zip.snapshot index e60adf77e..befe6c7f2 100644 --- a/test/Scripts.Tests/package-release.zip.snapshot +++ b/test/Scripts.Tests/package-release.zip.snapshot @@ -200,10 +200,15 @@ Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftm Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.private.swiftinterface Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.swiftdoc Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.swiftinterface +Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.abi.json +Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.private.swiftinterface +Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.swiftdoc +Plugins/iOS/Sentry.xcframework~/ios-arm64/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.swiftinterface Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/ Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/ Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Info.plist Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/ +Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/arm64e/Sentry.yml Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/aarch64/Sentry.yml Plugins/iOS/Sentry.xcframework~/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry Plugins/Linux/Sentry.meta From a74ff71ec022ec8663f7353c53bd44e8d3eca96b Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 25 Mar 2026 11:55:57 +0100 Subject: [PATCH 8/8] path --- Directory.Build.targets | 2 -- scripts/build-cocoa-sdk.ps1 | 26 ++++++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index e5b93b5b5..ca40195e1 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -161,8 +161,6 @@ Expected to exist: - - diff --git a/scripts/build-cocoa-sdk.ps1 b/scripts/build-cocoa-sdk.ps1 index 8ea3f758f..deb8444b7 100644 --- a/scripts/build-cocoa-sdk.ps1 +++ b/scripts/build-cocoa-sdk.ps1 @@ -20,11 +20,10 @@ if (-not (Test-Path (Join-Path $CocoaRoot "Sentry.xcodeproj"))) { exit 1 } -# Build intermediates are stored inside the submodule directory. Clean them to avoid stale builds -# when the submodule is updated to a new version. +# All build artifacts go under XCFrameworkBuildPath/ which is already in sentry-cocoa's .gitignore. $buildPath = Join-Path $CocoaRoot "XCFrameworkBuildPath" -$iOSXcframeworkPath = Join-Path $CocoaRoot "Sentry-Dynamic-iOS.xcframework" -$macOSXcframeworkPath = Join-Path $CocoaRoot "Sentry-Dynamic-macOS.xcframework" +$iOSXcframeworkPath = Join-Path $buildPath "Sentry-Dynamic-iOS.xcframework" +$macOSXcframeworkPath = Join-Path $buildPath "Sentry-Dynamic-macOS.xcframework" Write-Host "Building Cocoa SDK from source..." -ForegroundColor Yellow @@ -39,8 +38,13 @@ try { # ships separate "-WithARM64e" variants for apps that need it; Unity games don't. & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "iOSOnly" "arm64e" & ./scripts/validate-xcframework-format.sh "Sentry-Dynamic.xcframework" - # build-xcframework-variant.sh produces Sentry-Dynamic.xcframework — rename to keep iOS and macOS separate + # build-xcframework-variant.sh outputs to the working directory — move into our build cache Move-Item -Path "Sentry-Dynamic.xcframework" -Destination $iOSXcframeworkPath -Force + # Clean up intermediate archives, keep the final xcframework + $archivePath = Join-Path $buildPath "archive" + if (Test-Path $archivePath) { + Remove-Item -Path $archivePath -Recurse -Force + } } Write-Host "Setting up iOS frameworks..." -ForegroundColor Yellow @@ -68,11 +72,13 @@ try { & ./scripts/build-xcframework-variant.sh "Sentry" "-Dynamic" "mh_dylib" "" "macOSOnly" "" & ./scripts/validate-xcframework-format.sh "Sentry-Dynamic.xcframework" Move-Item -Path "Sentry-Dynamic.xcframework" -Destination $macOSXcframeworkPath -Force - } - - # Clean up build intermediates after both builds complete - if (Test-Path $buildPath) { - Remove-Item -Path $buildPath -Recurse -Force + # Clean up all remaining build intermediates + foreach ($dir in @("archive", "DerivedData")) { + $dirPath = Join-Path $buildPath $dir + if (Test-Path $dirPath) { + Remove-Item -Path $dirPath -Recurse -Force + } + } } Write-Host "Setting up macOS support..." -ForegroundColor Yellow