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
2 changes: 1 addition & 1 deletion .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ run_api_stability_for_prs: &run_api_stability_for_prs # API-related code
# Project files
- "Sentry.xcworkspace/**"
- "Sentry.xcodeproj/**"
- "Package.swift"
- "Package*.swift"

# Scripts
- "scripts/build-xcframework-local.sh"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- Sentry.xcworkspace/**
- Sentry.xcodeproj/**
- Gemfile.lock
- "Package.swift"
- "Package*.swift"
- "Makefile" # Make commands used for CI build setup
- "Brewfile*" # Dependency installation affects build environment

Expand Down
56 changes: 40 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- "scripts/ci-diagnostics.sh"
- Sentry.xcworkspace/**
- Sentry.xcodeproj/**
- "Package.swift"
- "Package*.swift"
- ".github/workflows/build-xcframework.yml"
- "scripts/build-xcframework-slice.sh"
- "scripts/assemble-xcframework.sh"
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
# the github.sha is be the pre merge commit id for PRs.
# See https://github.saobby.my.eu.orgmunity/t/github-sha-isnt-the-value-expected/17903/17906.
validate-spm:
name: Validate SPM Static
name: Validate SPM Static ${{matrix.package-file.name}}
runs-on: macos-14
needs: assemble-xcframework-variant
steps:
Expand All @@ -157,21 +157,29 @@ jobs:
with:
pattern: xcframework-${{github.sha}}-*
merge-multiple: true
- name: Remove newer package files
if: ${{ matrix.package-file.name == 'Package.swift' }}
run: rm -rf Package@swift*
- name: Change path of the framework
run: |
sed -i '' 's/url.*//g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift
sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' ${{matrix.package-file.name}}
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
shell: bash
- run: swift build
working-directory: Samples/macOS-SPM-CommandLine
- name: Run CI Diagnostics
if: failure()
run: ./scripts/ci-diagnostics.sh
strategy:
matrix:
package-file:
- name: Package.swift
- name: Package@swift-5.9.swift

validate-spm-dynamic:
name: Validate SPM Dynamic
name: Validate SPM Dynamic ${{matrix.package-file.name}}
runs-on: macos-14
needs: assemble-xcframework-variant
steps:
Expand All @@ -180,21 +188,29 @@ jobs:
with:
pattern: xcframework-${{github.sha}}-*
merge-multiple: true
- name: Remove newer package files
if: ${{ matrix.package-file.name == 'Package.swift' }}
run: rm -rf Package@swift*
- name: Change path of the framework
run: |
sed -i '' 's/url.*//g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift
sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' ${{matrix.package-file.name}}
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
shell: bash
- run: swift build
working-directory: Samples/SPM-Dynamic
- name: Run CI Diagnostics
if: failure()
run: ./scripts/ci-diagnostics.sh
strategy:
matrix:
package-file:
- name: Package.swift
- name: Package@swift-5.9.swift

swift-build:
name: Build Swift Static
name: Build Swift Static ${{matrix.package-file.name}}
runs-on: macos-14
needs: assemble-xcframework-variant
steps:
Expand All @@ -203,17 +219,25 @@ jobs:
with:
pattern: xcframework-${{github.sha}}-*
merge-multiple: true
- name: Remove newer package files
if: ${{ matrix.package-file.name == 'Package.swift' }}
run: rm -rf Package@swift*
- name: Change path of the framework
run: |
sed -i '' 's/url.*//g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' Package.swift
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' Package.swift
sed -i '' 's/url.*//g' ${{matrix.package-file.name}}
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' ${{matrix.package-file.name}}
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' ${{matrix.package-file.name}}
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' ${{matrix.package-file.name}}
shell: bash
- run: swift build
- name: Run CI Diagnostics
if: failure()
run: ./scripts/ci-diagnostics.sh
strategy:
matrix:
package-file:
- name: Package.swift
- name: Package@swift-5.9.swift

duplication-tests:
name: Test Sentry Duplication V4 # Up the version with every change to keep track of flaky tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- "Sources/**"
- "Sentry.podspec"
- "SentrySwiftUI.podspec"
- "Package.swift"
- "Package*.swift"
- "Makefile" # Make commands used for cross-platform setup
- "Brewfile*" # Dependency installation affects cross-platform testing
- "scripts/ci-diagnostics.sh"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Fixes

- Don't capture replays for events dropped in `beforeSend` (#5916)
- Fix linking with SentrySwiftUI on Xcode 26 for visionOS (#5823)

## 8.54.1-alpha.1

Expand Down
105 changes: 105 additions & 0 deletions Package@swift-5.9.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// swift-tools-version:5.9
// This Package.swift for Swift 5.9 (and newer) fixes an issue on Xcode 26 when linking `SentrySwiftUI`.
// Don't remove this comment.

#if canImport(Darwin)
import Darwin.C
#elseif canImport(Glibc)
import Glibc
#elseif canImport(MSVCRT)
import MSVCRT
#endif

import PackageDescription

var products: [Product] = [
.library(name: "Sentry", targets: ["Sentry"]),
.library(name: "Sentry-Dynamic", targets: ["Sentry-Dynamic"]),
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI"])
]

var targets: [Target] = [
.binaryTarget(
name: "Sentry",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.54.0/Sentry.xcframework.zip",
checksum: "f0f4b5582f7fef029ddedd22b6b9894a6d2d31ea9c7b52a2133b1ec7c4cff206" //Sentry-Static
),
.binaryTarget(
name: "Sentry-Dynamic",
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.54.0/Sentry-Dynamic.xcframework.zip",
checksum: "2cd3ee298133ed3a6d3b98f3b040e5c67b752887e67647ae671f450ecfd3facf" //Sentry-Dynamic
),
.target (
name: "SentrySwiftUI",
dependencies: ["Sentry", "SentryInternal"],
path: "Sources/SentrySwiftUI",
exclude: ["SentryInternal/", "module.modulemap"],
swiftSettings: [
.interoperabilityMode(.Cxx, .when(platforms: [.visionOS]))
],
linkerSettings: [
.linkedFramework("Sentry")
]),
.target(
name: "SentryInternal",
path: "Sources/SentrySwiftUI",
sources: [
"SentryInternal/"
],
publicHeadersPath: "SentryInternal/")
]

let env = getenv("EXPERIMENTAL_SPM_BUILDS")
if let env = env, String(cString: env) == "1" {
products.append(.library(name: "SentrySPM", type: .dynamic, targets: ["SentryObjc"]))
targets.append(contentsOf: [
// At least one source file is required, therefore we use a dummy class to satisfy the SPM build system
.target(
name: "SentryHeaders",
path: "Sources/Sentry",
sources: ["SentryDummyPublicEmptyClass.m"],
publicHeadersPath: "Public"
),
.target(
name: "_SentryPrivate",
dependencies: ["SentryHeaders"],
path: "Sources/Sentry",
sources: ["SentryDummyPrivateEmptyClass.m"],
publicHeadersPath: "include",
cSettings: [.headerSearchPath("include/HybridPublic")]),
.target(
name: "SentrySwift",
dependencies: ["_SentryPrivate", "SentryHeaders"],
path: "Sources/Swift",
swiftSettings: [
.unsafeFlags(["-enable-library-evolution"]),
// Some API breaking changes are necessary for the framework to compile with SPM, we’ll ship
// those in V9.
.define("SDK_V9")
]),
.target(
name: "SentryObjc",
dependencies: ["SentrySwift"],
path: "Sources",
exclude: ["Sentry/SentryDummyPublicEmptyClass.m", "Sentry/SentryDummyPrivateEmptyClass.m", "Swift", "SentrySwiftUI", "Resources", "Configuration"],
publicHeadersPath: "",
cSettings: [
.headerSearchPath("Sentry/include/HybridPublic"),
.headerSearchPath("Sentry"),
.headerSearchPath("SentryCrash/Recording"),
.headerSearchPath("SentryCrash/Recording/Monitors"),
.headerSearchPath("SentryCrash/Recording/Tools"),
.headerSearchPath("SentryCrash/Installations"),
.headerSearchPath("SentryCrash/Reporting/Filters"),
.headerSearchPath("SentryCrash/Reporting/Filters/Tools"),
.define("SDK_V9")])
])
}

let package = Package(
name: "Sentry",
platforms: [.iOS(.v11), .macOS(.v10_13), .tvOS(.v11), .watchOS(.v4), .visionOS(.v1)],
products: products,
targets: targets,
cxxLanguageStandard: .cxx14
)
Loading