Skip to content

Commit 57ab05c

Browse files
Fix some issues building for Library Evolution, Xcode 16 (#234)
* Corrects issues building for Library Evolution with Xcode 16 * Further adjust Makefile * Further adjust CI setup * Update CI and makefile. * wasm fix * enable macros * wip * wip * fix destinations * boop * fix yaml * fix yml * fix yml * fix * clean up * fix * wip --------- Co-authored-by: Brandon Williams <[email protected]>
1 parent 4e94646 commit 57ab05c

File tree

11 files changed

+140
-34
lines changed

11 files changed

+140
-34
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ concurrency:
1515

1616
jobs:
1717
library:
18-
runs-on: macos-14
18+
runs-on: macos-15
1919
strategy:
2020
matrix:
2121
xcode:
22-
- '15.4'
22+
- '16.2'
2323
variation:
2424
- ios
2525
- macos
@@ -36,6 +36,41 @@ jobs:
3636
- name: Run tests
3737
run: make test-${{ matrix.variation }}
3838

39+
library-15-4-compatibility:
40+
runs-on: macos-14
41+
strategy:
42+
matrix:
43+
xcode:
44+
- '15.4'
45+
ios_version:
46+
- '17.5'
47+
variation:
48+
- ios
49+
steps:
50+
- uses: actions/checkout@v4
51+
- name: Select Xcode ${{ matrix.xcode }}
52+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
53+
- name: Skip macro validation
54+
run: defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
55+
- name: Run tests
56+
run: make IOS_VERSION=${{matrix.ios_version}} test-${{ matrix.variation }}
57+
58+
library-evolution:
59+
name: Library Evolution
60+
runs-on: macos-15
61+
strategy:
62+
matrix:
63+
xcode:
64+
- '16.2'
65+
steps:
66+
- uses: actions/checkout@v4
67+
- name: Select Xcode ${{ matrix.xcode }}
68+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
69+
- name: Skip macro validation
70+
run: defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
71+
- name: Build for Library Evolution
72+
run: make build-for-library-evolution
73+
3974
wasm:
4075
name: Wasm
4176
runs-on: ubuntu-latest

Makefile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS 17.5,iPhone \d\+ Pro [^M])
1+
IOS_VERSION = 18.2
2+
TVOS_VERSION = 18.2
3+
WATCHOS_VERSION = 11.2
4+
OTHER_SWIFT_FLAGS="-DRESILIENT_LIBRARIES"
5+
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS $(IOS_VERSION),iPhone \d\+ Pro [^M])
26
PLATFORM_MACOS = macOS
3-
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,tvOS 17.5,TV)
4-
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,watchOS 10.5,Watch)
7+
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,tvOS $(TVOS_VERSION),TV)
8+
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,watchOS $(WATCHOS_VERSION),Watch)
59

610
TEST_RUNNER_CI = $(CI)
711

@@ -52,6 +56,19 @@ test-examples:
5256
-scheme CaseStudies \
5357
-destination platform="$(PLATFORM_IOS)"
5458

59+
build-for-library-evolution:
60+
swift build \
61+
-c release \
62+
-Xswiftc -emit-module-interface \
63+
-Xswiftc -enable-library-evolution \
64+
-Xswiftc $(OTHER_SWIFT_FLAGS)
65+
xcodebuild build \
66+
-workspace SwiftNavigation.xcworkspace \
67+
-destination platform="$(PLATFORM_IOS)" \
68+
-scheme SwiftNavigation \
69+
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
70+
OTHER_SWIFT_FLAGS=$(OTHER_SWIFT_FLAGS)
71+
5572
DOC_WARNINGS := $(shell xcodebuild clean docbuild \
5673
-scheme SwiftUINavigation \
5774
-destination platform="$(PLATFORM_MACOS)" \

Package.resolved

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ let package = Package(
3131
dependencies: [
3232
.package(url: "https://github.com/apple/swift-collections", from: "1.0.0"),
3333
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"),
34-
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.4"),
34+
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.6"),
3535
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.2.0"),
3636
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.2"),
3737
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.4"),
38-
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.2.2"),
38+
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.4.1"),
3939
],
4040
targets: [
4141
.target(

[email protected]

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ let package = Package(
3131
dependencies: [
3232
.package(url: "https://github.com/apple/swift-collections", from: "1.0.0"),
3333
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"),
34-
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.4"),
34+
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.6"),
3535
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.2.0"),
3636
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.2"),
3737
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.4"),
38-
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.2.2"),
38+
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.4.1"),
3939
],
4040
targets: [
4141
.target(

Sources/SwiftUINavigation/ConfirmationDialog.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
self = .hidden
1212
case .visible:
1313
self = .visible
14+
@unknown default:
15+
self = .automatic
1416
}
1517
}
1618
}

Sources/UIKitNavigation/Navigation/NavigationStackController.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,13 @@
251251
}
252252

253253
switch navigationController.path[nextIndex] {
254-
case .eager, .lazy(.codable):
255-
break
256254
case .lazy(.element(let element)):
257255
navigationController.path[nextIndex] = .eager(element)
256+
257+
case .eager, .lazy(.codable):
258+
fallthrough
259+
260+
@unknown default: break
258261
}
259262
return
260263
}
@@ -385,6 +388,7 @@
385388
return nil
386389
}
387390
return (destination(value as! D), value)
391+
@unknown default: return nil
388392
}
389393
}
390394
if stackController.path.contains(where: {
@@ -435,7 +439,8 @@
435439
case let .eager(element), let .lazy(.element(element)):
436440
return element.base as! Element
437441
case .lazy(.codable):
438-
fatalError()
442+
fallthrough
443+
@unknown default: fatalError()
439444
}
440445
}
441446
)

Sources/UIKitNavigation/Navigation/UIAlertController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
self = .cancel
6060
case .destructive:
6161
self = .destructive
62+
@unknown default:
63+
self = .default
6264
}
6365
}
6466
}

SwiftNavigation.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SwiftNavigation.xcworkspace/xcshareddata/xcschemes/SwiftNavigation.xcscheme

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,48 @@
2121
ReferencedContainer = "container:">
2222
</BuildableReference>
2323
</BuildActionEntry>
24+
<BuildActionEntry
25+
buildForTesting = "YES"
26+
buildForRunning = "YES"
27+
buildForProfiling = "YES"
28+
buildForArchiving = "YES"
29+
buildForAnalyzing = "YES">
30+
<BuildableReference
31+
BuildableIdentifier = "primary"
32+
BlueprintIdentifier = "AppKitNavigation"
33+
BuildableName = "AppKitNavigation"
34+
BlueprintName = "AppKitNavigation"
35+
ReferencedContainer = "container:">
36+
</BuildableReference>
37+
</BuildActionEntry>
38+
<BuildActionEntry
39+
buildForTesting = "YES"
40+
buildForRunning = "YES"
41+
buildForProfiling = "YES"
42+
buildForArchiving = "YES"
43+
buildForAnalyzing = "YES">
44+
<BuildableReference
45+
BuildableIdentifier = "primary"
46+
BlueprintIdentifier = "UIKitNavigation"
47+
BuildableName = "UIKitNavigation"
48+
BlueprintName = "UIKitNavigation"
49+
ReferencedContainer = "container:">
50+
</BuildableReference>
51+
</BuildActionEntry>
52+
<BuildActionEntry
53+
buildForTesting = "YES"
54+
buildForRunning = "YES"
55+
buildForProfiling = "YES"
56+
buildForArchiving = "YES"
57+
buildForAnalyzing = "YES">
58+
<BuildableReference
59+
BuildableIdentifier = "primary"
60+
BlueprintIdentifier = "SwiftUINavigation"
61+
BuildableName = "SwiftUINavigation"
62+
BlueprintName = "SwiftUINavigation"
63+
ReferencedContainer = "container:">
64+
</BuildableReference>
65+
</BuildActionEntry>
2466
</BuildActionEntries>
2567
</BuildAction>
2668
<TestAction

Tests/SwiftNavigationTests/UIBindingTests.swift

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,20 @@ final class UIBindingTests: XCTestCase {
4545
XCTAssertEqual(count, 1729)
4646
XCTAssertEqual(unwrappedCountBinding.wrappedValue, 1729)
4747

48-
XCTExpectFailure {
49-
let isCountPresent: UIBinding<Bool> = UIBinding($count)
50-
isCountPresent.wrappedValue = true
51-
} issueMatcher: {
52-
$0.compactDescription == """
53-
failed - Boolean presentation binding attempted to write 'true' to a generic 'UIBinding<Item?>' \
54-
(i.e., 'UIBinding<Int?>').
55-
56-
This is not a valid thing to do, as there is no way to convert 'true' to a new instance of \
57-
'Int'.
58-
"""
59-
}
48+
#if os(Darwin)
49+
XCTExpectFailure {
50+
let isCountPresent: UIBinding<Bool> = UIBinding($count)
51+
isCountPresent.wrappedValue = true
52+
} issueMatcher: {
53+
$0.compactDescription == """
54+
failed - Boolean presentation binding attempted to write 'true' to a generic 'UIBinding<Item?>' \
55+
(i.e., 'UIBinding<Int?>').
56+
57+
This is not a valid thing to do, as there is no way to convert 'true' to a new instance of \
58+
'Int'.
59+
"""
60+
}
61+
#endif
6062
}
6163

6264
func testOperationToOptional() {

0 commit comments

Comments
 (0)