diff --git a/.github/workflows/rust-pass-checks.yml b/.github/workflows/rust-pass-checks.yml index aca2bb04f..b6dcfa2ad 100644 --- a/.github/workflows/rust-pass-checks.yml +++ b/.github/workflows/rust-pass-checks.yml @@ -20,6 +20,7 @@ jobs: - ubuntu-22.04 - macos-11 - macos-12 + - macos-13 - windows-2019 - windows-2022 runs-on: ${{ matrix.runs-on }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e081f963e..ea621fddf 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -28,6 +28,7 @@ jobs: - ubuntu-22.04 - macos-11 - macos-12 + - macos-13 - windows-2019 - windows-2022 # TODO: https://github.com/rust-lang/cargo/issues/5220 @@ -40,6 +41,8 @@ jobs: packages: -p connlib-apple - runs-on: macos-12 packages: -p connlib-apple + - runs-on: macos-13 + packages: -p connlib-apple - runs-on: windows-2019 packages: -p firezone-client-connlib - runs-on: windows-2022 diff --git a/.github/workflows/swift-pass-checks.yml b/.github/workflows/swift-pass-checks.yml index c5e9a3375..e0c53d967 100644 --- a/.github/workflows/swift-pass-checks.yml +++ b/.github/workflows/swift-pass-checks.yml @@ -14,8 +14,14 @@ on: jobs: swift_build: + runs-on: ${{ matrix.runs-on.os }} strategy: matrix: + runs-on: + - os: macos-12 + xcode-ver: '14.2' + - os: macos-13 + xcode-ver: '14.3' target: - sdk: macosx platform: macOS @@ -23,6 +29,5 @@ jobs: - sdk: iphoneos platform: iOS destination: generic/platform=iOS - runs-on: ubuntu-latest steps: - run: 'echo "No build required"' diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 3b4959964..0e76af93e 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -17,8 +17,15 @@ concurrency: jobs: swift_build: + runs-on: ${{ matrix.runs-on.os }} strategy: + fail-fast: false matrix: + runs-on: + - os: macos-12 + xcode-ver: '14.2' + - os: macos-13 + xcode-ver: '14.3' target: - sdk: macosx platform: macOS @@ -26,7 +33,6 @@ jobs: - sdk: iphoneos platform: iOS destination: generic/platform=iOS - runs-on: macos-latest permissions: contents: read defaults: @@ -47,14 +53,14 @@ jobs: key: ${{ matrix.target.platform }}-spm-${{ hashFiles('**/Package.resolved') }} restore-keys: | ${{ matrix.target.platform }}-spm- + - run: | + sudo ls -al /Applications/ - name: Select Xcode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable + run: | + sudo xcode-select -s /Applications/Xcode_${{ matrix.runs-on.xcode-ver }}.app - name: Build app env: ONLY_ACTIVE_ARCH: no - working-directory: ./swift/apple run: | cp Firezone/xcconfig/Developer.xcconfig.ci-${{ matrix.target.platform }} Firezone/xcconfig/Developer.xcconfig diff --git a/rust/connlib/clients/apple/build-rust.sh b/rust/connlib/clients/apple/build-rust.sh index 51a171a0d..1d143e549 100755 --- a/rust/connlib/clients/apple/build-rust.sh +++ b/rust/connlib/clients/apple/build-rust.sh @@ -15,16 +15,14 @@ fi : "${PLATFORM_NAME:=macosx}" export PATH="$HOME/.cargo/bin:$PATH" - base_dir=$(xcrun --sdk $PLATFORM_NAME --show-sdk-path) - -# See https://github.com/briansmith/ring/issues/1332 -export LIBRARY_PATH="${base_dir}/usr/lib" export INCLUDE_PATH="${base_dir}/usr/include" +export LIBRARY_PATH="${base_dir}/usr/lib:${LIBRARY_PATH:-}" +export RUSTFLAGS="-C link-arg=-F$base_dir/System/Library/Frameworks" # `-Qunused-arguments` stops clang from failing while building *ring* # (but the library search path is still necessary when building the framework!) +# See https://github.com/briansmith/ring/issues/1332 export CFLAGS="-L ${LIBRARY_PATH} -I ${INCLUDE_PATH} -Qunused-arguments" -export RUSTFLAGS="-C link-arg=-F$base_dir/System/Library/Frameworks" # Borrowed from https://github.com/signalapp/libsignal/commit/02899cac643a14b2ced7c058cc15a836a2165b6d # Thanks to @francesca64 for the fix @@ -33,10 +31,10 @@ if [[ -n "${DEVELOPER_SDK_DIR:-}" ]]; then # In this case, we need to add an extra library search path for build scripts and proc-macros, # which run on the host instead of the target. # (macOS Big Sur does not have linkable libraries in /usr/lib/.) - if [[ "$PLATFORM_NAME" = "macosx" || "$PLATFORM_NAME" = "iphoneos" ]]; then - export LIBRARY_PATH="${DEVELOPER_SDK_DIR}/MacOSX.sdk/usr/lib:${LIBRARY_PATH:-}" - elif [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then - export LIBRARY_PATH="${DEVELOPER_SDK_DIR}/iPhoneSimulator.sdk/usr/lib:${LIBRARY_PATH:-}" + if [[ "$XCODE_VERSION_MAJOR" -lt "1500" ]]; then + # It appears we may not need this workaround with the new linker in Xcode 15, but GitHub Actions + # currently has spotty support for Xcode 15 on its macOS 13 VMs, so we'll keep this workaround for now. + export LIBRARY_PATH="${DEVELOPER_SDK_DIR}/MacOSX.sdk/usr/lib:${LIBRARY_PATH}" fi fi @@ -56,37 +54,16 @@ if [[ "$PLATFORM_NAME" = "macosx" ]]; then fi fi else - if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then - if [[ $CONFIGURATION == "Release" ]] || [[ -z "$NATIVE_ARCH" ]]; then - TARGETS=("aarch64-apple-ios-sim" "x86_64-apple-ios") - else - if [[ $NATIVE_ARCH == "arm64" ]]; then - TARGETS=("aarch64-apple-ios-sim") - else - if [[ $NATIVE_ARCH == "x86_64" ]]; then - TARGETS=("x86_64-apple-ios") - else - echo "Unsupported native arch for $PLATFORM_NAME: $NATIVE_ARCH" - fi - fi - fi + if [[ "$PLATFORM_NAME" = "iphoneos" ]]; then + TARGETS="aarch64-apple-ios" else - if [[ "$PLATFORM_NAME" = "iphoneos" ]]; then - TARGETS="aarch64-apple-ios" - else - echo "Unsupported platform: $PLATFORM_NAME" - exit 1 - fi + echo "Unsupported platform: $PLATFORM_NAME" + exit 1 fi fi MESSAGE="Building Connlib" -if [[ -n "$CONNLIB_MOCK" ]]; then - MESSAGE="${MESSAGE} (mock)" - FEATURE_ARGS="--features mock" -fi - if [[ $CONFIGURATION == "Release" ]]; then echo "${MESSAGE} for Release" CONFIGURATION_ARGS="--release" @@ -103,6 +80,6 @@ fi for target in "${TARGETS[@]}" do set -x - cargo build --target=$target $FEATURE_ARGS $CONFIGURATION_ARGS + cargo build --target=$target $CONFIGURATION_ARGS set +x done diff --git a/swift/apple/Firezone.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/swift/apple/Firezone.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index ea91b08ae..95ced56ed 100644 --- a/swift/apple/Firezone.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/swift/apple/Firezone.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/combine-schedulers", "state" : { - "revision" : "0625932976b3ae23949f6b816d13bd97f3b40b7c", - "version" : "0.10.0" + "revision" : "9dc9cbe4bc45c65164fa653a563d8d8db61b09bb", + "version" : "1.0.0" } }, { @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-case-paths", "state" : { - "revision" : "fc45e7b2cfece9dd80b5a45e6469ffe67fe67984", - "version" : "0.14.1" + "revision" : "5da6989aae464f324eef5c5b52bdb7974725ab81", + "version" : "1.0.0" } }, { @@ -23,8 +23,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-clocks", "state" : { - "revision" : "f9acfa1a45f4483fe0f2c434a74e6f68f865d12d", - "version" : "0.3.0" + "revision" : "d1fd837326aa719bee979bdde1f53cd5797443eb", + "version" : "1.0.0" + } + }, + { + "identity" : "swift-concurrency-extras", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-concurrency-extras", + "state" : { + "revision" : "ea631ce892687f5432a833312292b80db238186a", + "version" : "1.0.0" } }, { @@ -32,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-custom-dump", "state" : { - "revision" : "84b30e1af72e0ffe6dfbfe39d53b8173caacf224", - "version" : "0.10.2" + "revision" : "3efbfba0e4e56c7187cc19137ee16b7c95346b79", + "version" : "1.1.0" } }, { @@ -41,8 +50,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-dependencies", "state" : { - "revision" : "ad0a6a0dd4d4741263e798f4f5029589c9b5da73", - "version" : "0.4.2" + "revision" : "4e1eb6e28afe723286d8cc60611237ffbddba7c5", + "version" : "1.0.0" } }, { @@ -50,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swiftui-navigation", "state" : { - "revision" : "47dd574b900ba5ba679f56ea00d4d282fc7305a6", - "version" : "0.7.1" + "revision" : "6eb293c49505d86e9e24232cb6af6be7fff93bd5", + "version" : "1.0.2" } }, { @@ -59,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", "state" : { - "revision" : "4af50b38daf0037cfbab15514a241224c3f62f98", - "version" : "0.8.5" + "revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631", + "version" : "1.0.2" } } ], diff --git a/swift/apple/FirezoneKit/Package.resolved b/swift/apple/FirezoneKit/Package.resolved deleted file mode 100644 index be4512c58..000000000 --- a/swift/apple/FirezoneKit/Package.resolved +++ /dev/null @@ -1,68 +0,0 @@ -{ - "pins" : [ - { - "identity" : "combine-schedulers", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/combine-schedulers", - "state" : { - "revision" : "882ac01eb7ef9e36d4467eb4b1151e74fcef85ab", - "version" : "0.9.1" - } - }, - { - "identity" : "swift-case-paths", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-case-paths", - "state" : { - "revision" : "870133b7b2387df136ad301ec67b2e864b51dda1", - "version" : "0.14.0" - } - }, - { - "identity" : "swift-clocks", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-clocks", - "state" : { - "revision" : "20b25ca0dd88ebfb9111ec937814ddc5a8880172", - "version" : "0.2.0" - } - }, - { - "identity" : "swift-custom-dump", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-custom-dump", - "state" : { - "revision" : "de8ba65649e7ee317b9daf27dd5eebf34bd4be57", - "version" : "0.9.1" - } - }, - { - "identity" : "swift-dependencies", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-dependencies", - "state" : { - "revision" : "6bb1034e8a1bfbf46dfb766b6c09b7b17e1cba10", - "version" : "0.2.0" - } - }, - { - "identity" : "swiftui-navigation", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swiftui-navigation", - "state" : { - "revision" : "47dd574b900ba5ba679f56ea00d4d282fc7305a6", - "version" : "0.7.1" - } - }, - { - "identity" : "xctest-dynamic-overlay", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", - "state" : { - "revision" : "ab8c9f45843694dd16be4297e6d44c0634fd9913", - "version" : "0.8.4" - } - } - ], - "version" : 2 -} diff --git a/swift/apple/FirezoneKit/Package.swift b/swift/apple/FirezoneKit/Package.swift index f206a8cf0..11f28bf02 100644 --- a/swift/apple/FirezoneKit/Package.swift +++ b/swift/apple/FirezoneKit/Package.swift @@ -9,19 +9,19 @@ let package = Package( products: [ // Products define the executables and libraries a package produces, and make them visible to // other packages. - .library(name: "FirezoneKit", targets: ["FirezoneKit"]), + .library(name: "FirezoneKit", targets: ["FirezoneKit"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/pointfreeco/swift-dependencies", from: "0.1.3"), - .package(url: "https://github.com/pointfreeco/swiftui-navigation", from: "0.5.0"), + .package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.0.0"), + .package(url: "https://github.com/pointfreeco/swiftui-navigation", from: "1.0.0"), ], targets: [ .target( name: "FirezoneKit", dependencies: [ .product(name: "SwiftUINavigation", package: "swiftui-navigation"), - .product(name: "_SwiftUINavigationState", package: "swiftui-navigation"), + .product(name: "SwiftUINavigationCore", package: "swiftui-navigation"), .product(name: "Dependencies", package: "swift-dependencies"), ] ), diff --git a/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/AppView.swift b/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/AppView.swift index 662db4771..d1ab61cf8 100644 --- a/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/AppView.swift +++ b/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/AppView.swift @@ -4,11 +4,11 @@ // LICENSE: Apache-2.0 // -import _SwiftUINavigationState import Combine import Dependencies import SwiftUI import SwiftUINavigation +import SwiftUINavigationCore #if os(iOS) @MainActor diff --git a/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/WelcomeView.swift b/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/WelcomeView.swift index 496749ec6..eb16c71a5 100644 --- a/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/WelcomeView.swift +++ b/swift/apple/FirezoneKit/Sources/FirezoneKit/Features/WelcomeView.swift @@ -4,11 +4,11 @@ // LICENSE: Apache-2.0 // -import _SwiftUINavigationState import Combine import Dependencies import SwiftUI import SwiftUINavigation +import SwiftUINavigationCore #if os(iOS) @MainActor diff --git a/swift/apple/FirezoneKit/Sources/FirezoneKit/Views/Alerts.swift b/swift/apple/FirezoneKit/Sources/FirezoneKit/Views/Alerts.swift index 2b405d8c1..81d8f3144 100644 --- a/swift/apple/FirezoneKit/Sources/FirezoneKit/Views/Alerts.swift +++ b/swift/apple/FirezoneKit/Sources/FirezoneKit/Views/Alerts.swift @@ -4,7 +4,7 @@ // LICENSE: Apache-2.0 // -import _SwiftUINavigationState +import SwiftUINavigationCore #if os(iOS) extension AlertState where Action == WelcomeViewModel.UndefinedSettingsAlertAction {