From 7ada838f2ad037190ce79eae6b637f29a3ac4957 Mon Sep 17 00:00:00 2001 From: Gemma Barlow Date: Wed, 25 Sep 2024 14:07:20 -0400 Subject: [PATCH] Create a Makefile target simulating building for Library Evolution; address issues with Xcode 16 running it (#199) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add a Makefile target build-for-library-evolution Replicates an issue I’m seeing in our project * Update xctest-dynamic-overlay to 1.4.1 * Update swift-syntax * Add param to build-for-library-evolution * Corrects issue seen via `make build-for-library-evolution` * Correct a small syntax error * Add job to CI, covering Library Evolution Makefile target * Revert to macos-14 --- .github/workflows/ci.yml | 17 +++++++++++++++++ Makefile | 8 ++++++++ Package.resolved | 8 ++++---- Sources/CasePathsMacros/CasePathableMacro.swift | 1 + 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9a6e568..7de80851 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,23 @@ jobs: - name: Run tests run: make test-swift + macos-library-evolution: + name: macOS Library Evolution (Xcode ${{ matrix.xcode }}) + runs-on: macos-latest + strategy: + matrix: + xcode: + - '15.4' + - '16.0' + steps: + - uses: actions/checkout@v4 + - name: Select Xcode ${{ matrix.xcode }} + run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app + - name: Print Swift version + run: swift --version + - name: Build for Library Evolution + run: make build-for-library-evolution + linux: strategy: matrix: diff --git a/Makefile b/Makefile index 7134731c..ff76200c 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,14 @@ test-swift: -c release \ --parallel +build-for-library-evolution: + swift build \ + -c release \ + --target CasePaths \ + -Xswiftc -emit-module-interface \ + -Xswiftc -enable-library-evolution \ + -Xswiftc -DRESILIENT_LIBRARIES # Required to build swift-syntax; see https://github.com/swiftlang/swift-syntax/pull/2540 + format: swift format --in-place --recursive . diff --git a/Package.resolved b/Package.resolved index 1275e866..9df50729 100644 --- a/Package.resolved +++ b/Package.resolved @@ -42,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/swiftlang/swift-syntax", "state" : { - "revision" : "4c6cc0a3b9e8f14b3ae2307c5ccae4de6167ac2c", - "version" : "600.0.0-prerelease-2024-06-12" + "revision" : "cb53fa1bd3219b0b23ded7dfdd3b2baff266fd25", + "version" : "600.0.0" } }, { @@ -51,8 +51,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", "state" : { - "revision" : "357ca1e5dd31f613a1d43320870ebc219386a495", - "version" : "1.2.2" + "revision" : "27d767d643fa2cf083d0a73d74fa84cacb53e85c", + "version" : "1.4.1" } } ], diff --git a/Sources/CasePathsMacros/CasePathableMacro.swift b/Sources/CasePathsMacros/CasePathableMacro.swift index 69ba8fa1..e87e6797 100644 --- a/Sources/CasePathsMacros/CasePathableMacro.swift +++ b/Sources/CasePathsMacros/CasePathableMacro.swift @@ -292,6 +292,7 @@ extension AttributeListSyntax.Element { if let availability = ifConfig.availability { return .ifConfigDecl(availability) } + @unknown default: return nil } return nil }