Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some issues building for Library Evolution, Xcode 16 #234

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
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
45 changes: 34 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,46 @@ jobs:
runs-on: macos-14
strategy:
matrix:
xcode:
- '15.4'
variation:
- ios
- macos
- tvos
- watchos
- examples
combination:
- xcode: '15.4'
variation: ios
- xcode: '16.0'
variation: ios

- xcode: '15.4'
variation: tvos
- xcode: '16.0'
variation: tvos

- xcode: '15.4'
variation: watchos
- xcode: '16.0'
variation: watchos

- xcode: '15.4'
variation: macos
- xcode: '16.0'
variation: macos

- xcode: '15.4'
variation: examples
- xcode: '16.0'
variation: examples

steps:
- uses: actions/checkout@v4
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Select Xcode ${{ matrix.combination.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.combination.xcode }}.app
- name: Skip macro validation
run: defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
- name: List devices
run: |
xcodebuild -runFirstLaunch
xcrun simctl list devices available
- name: Run Library Evolution builds
run: make build-for-library-evolution
- name: Run tests
run: make test-${{ matrix.variation }}
run: make test-${{ matrix.combination.variation }}

wasm:
name: SwiftWasm
Expand Down
43 changes: 39 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS 17.5,iPhone \d\+ Pro [^M])
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS,iPhone \d\+ Pro [^M])
PLATFORM_MACOS = macOS
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,tvOS 17.5,TV)
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,watchOS 10.5,Watch)

PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,tvOS,TV)
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,watchOS,Watch)
TEST_RUNNER_CI = $(CI)

OTHER_SWIFT_FLAGS="-DRESILIENT_LIBRARIES"

default: test

test: test-ios test-macos test-tvos test-watchos test-examples
Expand Down Expand Up @@ -65,6 +66,40 @@ test-docs:
|| (echo "xcodebuild docbuild failed:\n\n$(DOC_WARNINGS)" | tr '\1' '\n' \
&& exit 1)

build-for-library-evolution: build-for-library-evolution-ios build-for-library-evolution-macos

build-for-library-evolution-macos:
swift build \
-c release \
--target SwiftUINavigation \
-Xswiftc -emit-module-interface \
-Xswiftc -enable-library-evolution \
-Xswiftc $(OTHER_SWIFT_FLAGS)

swift build \
-c release \
--target AppKitNavigation \
-Xswiftc -emit-module-interface \
-Xswiftc -enable-library-evolution \
-Xswiftc $(OTHER_SWIFT_FLAGS)

build-for-library-evolution-ios:
xcodebuild build \
-skipMacroValidation \
-workspace SwiftNavigation.xcworkspace \
-scheme SwiftUINavigation \
-destination platform="$(PLATFORM_IOS)" \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
OTHER_SWIFT_FLAGS=$(OTHER_SWIFT_FLAGS)

xcodebuild build \
-skipMacroValidation \
-workspace SwiftNavigation.xcworkspace \
-scheme UIKitNavigation \
-destination platform="$(PLATFORM_IOS)" \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
OTHER_SWIFT_FLAGS=$(OTHER_SWIFT_FLAGS)

format:
swift format \
--ignore-unparsable-files \
Expand Down
10 changes: 5 additions & 5 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"originHash" : "21426c7e67e0003e5a1e08c0f4323d81f8190a1dc8c3b2f9dc9f8fed20da343d",
"originHash" : "dadd94aa62198c583e409ca79659dfe74682ffa52469a2e320148e9ead2cfaaf",
"pins" : [
{
"identity" : "swift-case-paths",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths",
"state" : {
"revision" : "642e6aab8e03e5f992d9c83e38c5be98cfad5078",
"version" : "1.5.5"
"branch" : "1.5.6",
"revision" : "bc92c4b27f9a84bfb498cdbfdf35d5a357e9161f"
}
},
{
Expand Down Expand Up @@ -78,8 +78,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "96beb108a57f24c8476ae1f309239270772b2940",
"version" : "1.2.5"
"revision" : "27d767d643fa2cf083d0a73d74fa84cacb53e85c",
"version" : "1.4.1"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/apple/swift-collections", from: "1.0.0"),
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.4"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", branch: "1.5.6"),
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.2.0"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.2"),
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.4"),
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.2.2"),
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.4.1"),
],
targets: [
.target(
Expand Down
4 changes: 2 additions & 2 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/apple/swift-collections", from: "1.0.0"),
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.4"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", branch: "1.5.6"),
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.2.0"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.3.2"),
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.4"),
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.2.2"),
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.4.1"),
],
targets: [
.target(
Expand Down
2 changes: 2 additions & 0 deletions Sources/SwiftUINavigation/ConfirmationDialog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
self = .hidden
case .visible:
self = .visible
@unknown default:
self = .automatic
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,13 @@
}

switch navigationController.path[nextIndex] {
case .eager, .lazy(.codable):
break
case .lazy(.element(let element)):
navigationController.path[nextIndex] = .eager(element)

case .eager, .lazy(.codable):
fallthrough

@unknown default: break
}
return
}
Expand Down Expand Up @@ -385,6 +388,7 @@
return nil
}
return (destination(value as! D), value)
@unknown default: return nil
}
}
if stackController.path.contains(where: {
Expand Down Expand Up @@ -435,7 +439,8 @@
case let .eager(element), let .lazy(.element(element)):
return element.base as! Element
case .lazy(.codable):
fatalError()
fallthrough
@unknown default: fatalError()
}
}
)
Expand Down
2 changes: 2 additions & 0 deletions Sources/UIKitNavigation/Navigation/UIAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
self = .cancel
case .destructive:
self = .destructive
@unknown default:
self = .default
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "75dae436fdc9b1a44a669fa8368ae31049099c9154e577dc38707ff965cdebf8",
"pins" : [
{
"identity" : "combine-schedulers",
Expand All @@ -14,8 +15,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths",
"state" : {
"revision" : "71344dd930fde41e8f3adafe260adcbb2fc2a3dc",
"version" : "1.5.4"
gemmakbarlow marked this conversation as resolved.
Show resolved Hide resolved
"branch" : "1.5.6",
"revision" : "bc92c4b27f9a84bfb498cdbfdf35d5a357e9161f"
}
},
{
Expand Down Expand Up @@ -122,10 +123,10 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "357ca1e5dd31f613a1d43320870ebc219386a495",
"version" : "1.2.2"
"revision" : "27d767d643fa2cf083d0a73d74fa84cacb53e85c",
"version" : "1.4.1"
}
}
],
"version" : 2
"version" : 3
}
Loading