Skip to content

Commit f2e369d

Browse files
authored
chore: Add Package@swift-6.2.swift (#7778)
* chore: add Package@swift-6.2.swift for compatibility with Xcode 26 * Update Package@swift-6.2.swift * Update changelog * chore: add Package@swift-6.2.swift to version bump list * Update changelog * Sync Package@swift-6.2 to 9.10.0
1 parent 7b089f4 commit f2e369d

5 files changed

Lines changed: 146 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ jobs:
168168
--package-file Package@swift-6.1.swift \
169169
--is-pr "${{ github.event_name == 'pull_request' }}" \
170170
--change-path true
171+
./scripts/prepare-package.sh \
172+
--package-file Package@swift-6.2.swift \
173+
--is-pr "${{ github.event_name == 'pull_request' }}" \
174+
--change-path true
171175
- run: ./scripts/ci-select-xcode.sh 16.4
172176
- run: swift build
173177
working-directory: Samples/macOS-SPM-CommandLine
@@ -198,6 +202,10 @@ jobs:
198202
--package-file Package@swift-6.1.swift \
199203
--is-pr "${{ github.event_name == 'pull_request' }}" \
200204
--change-path true
205+
./scripts/prepare-package.sh \
206+
--package-file Package@swift-6.2.swift \
207+
--is-pr "${{ github.event_name == 'pull_request' }}" \
208+
--change-path true
201209
- run: ./scripts/ci-select-xcode.sh 16.4
202210
- run: swift build
203211
working-directory: Samples/SPM-Dynamic
@@ -228,6 +236,10 @@ jobs:
228236
--package-file Package@swift-6.1.swift \
229237
--is-pr "${{ github.event_name == 'pull_request' }}" \
230238
--change-path true
239+
./scripts/prepare-package.sh \
240+
--package-file Package@swift-6.2.swift \
241+
--is-pr "${{ github.event_name == 'pull_request' }}" \
242+
--change-path true
231243
- run: ./scripts/ci-select-xcode.sh 16.4
232244
- run: swift build --target SentrySwiftUI
233245
- name: Run CI Diagnostics
@@ -257,6 +269,10 @@ jobs:
257269
--package-file Package@swift-6.1.swift \
258270
--is-pr "${{ github.event_name == 'pull_request' }}" \
259271
--change-path true
272+
./scripts/prepare-package.sh \
273+
--package-file Package@swift-6.2.swift \
274+
--is-pr "${{ github.event_name == 'pull_request' }}" \
275+
--change-path true
260276
- run: ./scripts/ci-select-xcode.sh 16.4
261277
- run: set -o pipefail &&xcodebuild build -scheme visionOS-SPM -sdk xros -destination 'generic/platform=xros' | tee raw-build-output-spm-visionOS.log | xcbeautify
262278
working-directory: Samples/visionOS-SPM

.github/workflows/test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,15 @@ jobs:
112112
- name: Prepare Package.swift
113113
shell: bash
114114
run: |
115-
# Swift 6.1+ uses Package@swift-6.1.swift; hide it so prepare-package's
115+
# Swift 6.1+ and 6.2+ uses Package@swift-6.1.swift and Package@swift-6.2.swift; hide it so prepare-package's
116116
# modified Package.swift is used (avoids "Multiple commands produce" from
117-
# unmodified binary targets in the 6.1 manifest).
117+
# unmodified binary targets in the 6.1 and 6.2 manifests).
118118
if [[ -f Package@swift-6.1.swift ]]; then
119119
mv Package@swift-6.1.swift Package@swift-6.1.swift.bak
120120
fi
121+
if [[ -f Package@swift-6.2.swift ]]; then
122+
mv Package@swift-6.2.swift Package@swift-6.2.swift.bak
123+
fi
121124
./scripts/prepare-package.sh \
122125
--package-file Package.swift \
123126
--is-pr "${{ github.event_name == 'pull_request' }}" \

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
### Fixes
1010

11+
- Added `Package@swift-6.2.swift` to avoid issues with unsafe build flags on SPM > 6.2 (#7778)
1112
- Detect development builds via provisioning profile and debugger attachment (#7702)
1213
- Keep replayType as `buffer` for Session Replay triggered by an error (#7804)
1314
- Fix race condition in scope observer notifications causing EXC_BAD_ACCESS during cold launch (#7807)

Package@swift-6.2.swift

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
// swift-tools-version:6.2
2+
3+
#if canImport(Darwin)
4+
import Darwin.C
5+
#elseif canImport(Glibc)
6+
import Glibc
7+
#elseif canImport(MSVCRT)
8+
import MSVCRT
9+
#endif
10+
11+
import PackageDescription
12+
13+
var products: [Product] = [
14+
.library(name: "Sentry", targets: ["Sentry", "SentryCppHelper"]),
15+
.library(name: "Sentry-Dynamic", targets: ["Sentry-Dynamic"]),
16+
.library(name: "Sentry-Dynamic-WithARM64e", targets: ["Sentry-Dynamic-WithARM64e"]),
17+
.library(name: "Sentry-WithoutUIKitOrAppKit", targets: ["Sentry-WithoutUIKitOrAppKit", "SentryCppHelper"]),
18+
.library(name: "Sentry-WithoutUIKitOrAppKit-WithARM64e", targets: ["Sentry-WithoutUIKitOrAppKit-WithARM64e", "SentryCppHelper"]),
19+
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI", "SentryCppHelper"]),
20+
.library(name: "SentryDistribution", targets: ["SentryDistribution"])
21+
]
22+
23+
var targets: [Target] = [
24+
.binaryTarget(
25+
name: "Sentry",
26+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.10.0/Sentry.xcframework.zip",
27+
checksum: "166692d02bb59fe9a158fe59b16e122fda40dddf6deaabed65a9e4b240f84c9b" //Sentry-Static
28+
),
29+
.binaryTarget(
30+
name: "Sentry-Dynamic",
31+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.10.0/Sentry-Dynamic.xcframework.zip",
32+
checksum: "1dd70512f3b5af6c74f1b8f11279531900173fb638d7d541320a7cbc00ed06bc" //Sentry-Dynamic
33+
),
34+
.binaryTarget(
35+
name: "Sentry-Dynamic-WithARM64e",
36+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.10.0/Sentry-Dynamic-WithARM64e.xcframework.zip",
37+
checksum: "7d981d7ad0686c5fd68c791b721820a360285dc711e2b23e79114a6a62d799a6" //Sentry-Dynamic-WithARM64e
38+
),
39+
.binaryTarget(
40+
name: "Sentry-WithoutUIKitOrAppKit",
41+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.10.0/Sentry-WithoutUIKitOrAppKit.xcframework.zip",
42+
checksum: "8c70de11731587e2c615089464820b67d8f0103b5e019d81a16b0cac31e33e65" //Sentry-WithoutUIKitOrAppKit
43+
),
44+
.binaryTarget(
45+
name: "Sentry-WithoutUIKitOrAppKit-WithARM64e",
46+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.10.0/Sentry-WithoutUIKitOrAppKit-WithARM64e.xcframework.zip",
47+
checksum: "abd3b0836ce6637cbc274e7d979b345ec3c2f46857d5412e78c1d2f0fe3397b0" //Sentry-WithoutUIKitOrAppKit-WithARM64e
48+
),
49+
.target(
50+
name: "SentrySwiftUI",
51+
dependencies: ["Sentry"],
52+
path: "Sources/SentrySwiftUI",
53+
exclude: ["module.modulemap"],
54+
linkerSettings: [
55+
.linkedFramework("Sentry")
56+
]
57+
),
58+
.target(
59+
name: "SentryCppHelper",
60+
path: "Sources/SentryCppHelper",
61+
linkerSettings: [
62+
.linkedLibrary("c++")
63+
]
64+
),
65+
.target(name: "SentryDistribution", path: "Sources/SentryDistribution"),
66+
.testTarget(name: "SentryDistributionTests", dependencies: ["SentryDistribution"], path: "Sources/SentryDistributionTests")
67+
]
68+
69+
// Targets required to support compile-from-source builds via SPM.
70+
products.append(.library(name: "SentrySPM", targets: ["SentryObjCInternal"]))
71+
targets += [
72+
// At least one source file is required, therefore we use a dummy class to satisfy the SPM build system
73+
.target(
74+
name: "SentryHeaders",
75+
path: "Sources/Sentry",
76+
sources: ["SentryDummyPublicEmptyClass.m"],
77+
publicHeadersPath: "Public"
78+
),
79+
.target(
80+
name: "_SentryPrivate",
81+
dependencies: ["SentryHeaders"],
82+
path: "Sources/Sentry",
83+
sources: ["SentryDummyPrivateEmptyClass.m"],
84+
publicHeadersPath: "include"),
85+
.target(
86+
name: "SentrySwift",
87+
dependencies: ["_SentryPrivate", "SentryHeaders"],
88+
path: "Sources/Swift",
89+
swiftSettings: [
90+
.unsafeFlags(["-enable-library-evolution"]),
91+
.define("SENTRY_NO_UI_FRAMEWORK", .when(traits: ["NoUIFramework"]))
92+
]),
93+
94+
// SentryObjCInternal compiles all ObjC/C sources from the repo. Named "Internal"
95+
// to reserve "SentryObjC" for a future public Objective-C wrapper around the SDK.
96+
.target(
97+
name: "SentryObjCInternal",
98+
dependencies: ["SentrySwift"],
99+
path: "Sources",
100+
exclude: ["Sentry/SentryDummyPublicEmptyClass.m", "Sentry/SentryDummyPrivateEmptyClass.m", "Swift", "SentrySwiftUI", "Resources", "Configuration", "SentryCppHelper", "SentryDistribution", "SentryDistributionTests"],
101+
cSettings: [
102+
.headerSearchPath("Sentry"),
103+
.headerSearchPath("SentryCrash/Recording"),
104+
.headerSearchPath("SentryCrash/Recording/Monitors"),
105+
.headerSearchPath("SentryCrash/Recording/Tools"),
106+
.headerSearchPath("SentryCrash/Installations"),
107+
.headerSearchPath("SentryCrash/Reporting/Filters"),
108+
.headerSearchPath("SentryCrash/Reporting/Filters/Tools"),
109+
.define("SENTRY_NO_UI_FRAMEWORK", to: "1", .when(traits: ["NoUIFramework"]))
110+
])
111+
]
112+
113+
let package = Package(
114+
name: "Sentry",
115+
platforms: [.iOS(.v15), .macOS(.v10_14), .tvOS(.v15), .watchOS(.v8), .visionOS(.v1)],
116+
products: products,
117+
traits: [
118+
.init(name: "NoUIFramework", description: "Build without UIKit/AppKit framework linkage. Use for command-line tools or contexts where UI frameworks are unavailable.")
119+
],
120+
targets: targets,
121+
swiftLanguageModes: [.v5],
122+
cxxLanguageStandard: .cxx14
123+
)

Utils/VersionBump/main.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ let files = [
4040
"./Sentry.podspec",
4141
"./Package.swift",
4242
"./Package@swift-6.1.swift",
43+
"./Package@swift-6.2.swift",
4344
"./SentrySwiftUI.podspec",
4445
"./Sources/Sentry/SentryMeta.m",
4546
"./3rd-party-integrations/SentrySwiftLog/Package.swift",

0 commit comments

Comments
 (0)