Skip to content

Commit d111465

Browse files
pblazejclaude
andauthored
Drop Swift 5 (#969)
Swift 5 is dead for 1y now: https://developer.apple.com/news/upcoming-requirements/?id=02212025a Notable changes: - consolidates `Package.swift`, `6.2` will be removed as we move to `.26` - removes all conditionals (mostly around concurrency) - leaves macOS 14 CI for now, with updated Xcode This is a prerequisite to: #922 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c396df6 commit d111465

36 files changed

Lines changed: 34 additions & 198 deletions

.changes/drop-swift-5-support

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
minor type="changed" "Drop Xcode 15 (Swift 5.x) support; minimum is now Xcode 16 / Swift 6.0"

.github/workflows/ci.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
include:
30-
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
30+
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
3131
- os: macos-14
32-
xcode: 15.4
33-
platform: "iOS Simulator,name=iPhone 15 Pro,OS=17.5"
32+
xcode: 16.2
33+
platform: "iOS Simulator,name=iPhone 16 Pro,OS=18.2"
3434
- os: macos-14
35-
xcode: 15.4
35+
xcode: 16.2
3636
platform: "macOS"
3737
- os: macos-14
38-
xcode: 15.4
38+
xcode: 16.2
3939
platform: "macOS,variant=Mac Catalyst"
4040
- os: macos-14
41-
xcode: 15.4
42-
platform: "tvOS Simulator,name=Apple TV,OS=17.5"
41+
xcode: 16.2
42+
platform: "tvOS Simulator,name=Apple TV,OS=18.2"
4343

4444
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
4545
- os: macos-15

.github/workflows/cocoapods-lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
include:
1717
- os: macos-14
18-
xcode: 15.4
18+
xcode: 16.2
1919
- os: macos-15
2020
xcode: 16.4
2121
- os: macos-26

.swift-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.swiftformat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--swiftversion 6.0
12
--exclude Sources/LiveKit/Protos
23
--header "/*\n * Copyright {year} LiveKit\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */"
34
--ifdef no-indent

AGENTS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ Threading:
8383

8484
### Language Version
8585

86-
- Supported Xcode versions: current minus two major versions (including beta)
87-
- `Package.swift` and `.swift-version` declare the **oldest** supported version (e.g., `swift-tools-version:5.9`) for backwards compatibility
88-
- Keep all manifests in sync when adding dependencies
86+
- Minimum supported Xcode is Xcode 16 (Swift 6.0); see Apple's [App Store submission requirements](https://developer.apple.com/news/upcoming-requirements/?id=02212025a)
87+
- `Package.swift` (`swift-tools-version:6.0`) declares the **oldest** supported version
88+
- Keep `Package.swift`, `LiveKitClient.podspec`, and `.swiftformat`'s `--swiftversion` in sync when changing the minimum
8989
- New code should use the latest stable Swift version
90-
- Some constructs require `#if swift` or `#if compiler` directives for version compatibility:
90+
- Some constructs require `#if swift` or `#if compiler` directives to support newer-than-minimum toolchains:
9191

9292
```swift
93-
#if swift(>=6.0)
94-
public nonisolated(unsafe) static let shared = AudioManager()
93+
#if swift(>=6.2)
94+
private static let playAndRecordOptions: AVAudioSession.CategoryOptions = [.mixWithOthers, .allowBluetoothHFP, .allowBluetoothA2DP, .allowAirPlay]
9595
#else
96-
public static let shared = AudioManager()
96+
private static let playAndRecordOptions: AVAudioSession.CategoryOptions = [.mixWithOthers, .allowBluetooth, .allowBluetoothA2DP, .allowAirPlay]
9797
#endif
9898
```
9999

LiveKitClient.podspec

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,4 @@ Pod::Spec.new do |spec|
1919
spec.dependency("SwiftProtobuf")
2020

2121
spec.resource_bundles = {"Privacy" => ["Sources/LiveKit/PrivacyInfo.xcprivacy"]}
22-
23-
xcode_output = `xcodebuild -version`.strip
24-
major_version = xcode_output =~ /Xcode\s+(\d+)/ ? $1.to_i : 15
25-
26-
spec.pod_target_xcconfig = {
27-
"OTHER_SWIFT_FLAGS" => major_version >=15 ?
28-
"-enable-experimental-feature AccessLevelOnImport" : ""
29-
}
3022
end

Package.swift

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// swift-tools-version:5.9
2-
// (Xcode15.0+)
1+
// swift-tools-version:6.0
2+
// (Xcode16.0+)
33

44
import PackageDescription
55

@@ -43,9 +43,6 @@ let package = Package(
4343
],
4444
resources: [
4545
.process("PrivacyInfo.xcprivacy"),
46-
],
47-
swiftSettings: [
48-
.enableExperimentalFeature("AccessLevelOnImport"),
4946
]
5047
),
5148
.target(
@@ -77,7 +74,5 @@ let package = Package(
7774
]
7875
),
7976
],
80-
swiftLanguageVersions: [
81-
.v5,
82-
]
77+
swiftLanguageModes: [.v5, .v6]
8378
)

Package@swift-6.0.swift

Lines changed: 0 additions & 84 deletions
This file was deleted.

Package@swift-6.2.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ let package = Package(
4444
],
4545
resources: [
4646
.process("PrivacyInfo.xcprivacy"),
47-
],
48-
swiftSettings: [
49-
.enableExperimentalFeature("AccessLevelOnImport"),
5047
]
5148
),
5249
.target(
@@ -78,8 +75,5 @@ let package = Package(
7875
]
7976
),
8077
],
81-
swiftLanguageModes: [
82-
.v5, // opt-out from dynamic actor isolation checks
83-
.v6,
84-
]
78+
swiftLanguageModes: [.v5, .v6]
8579
)

0 commit comments

Comments
 (0)