Repository navigation
fix macOS CI Swiftly XCTest handling - #923
Merged
Merged
Conversation
Hokila
marked this pull request as draft
September 24, 2026 15:09
Hokila
force-pushed
the
fix-macos-ci-xctest
branch
from
September 24, 2026 15:58
3b5a31e to
53f796d
Compare
Hokila
marked this pull request as ready for review
September 24, 2026 16:04
Swiftly on macOS can fail to import XCTest while compiling test support. Keep the Swiftly build focused on production targets and run both test modes with Xcode Swift. SwiftPM build plugins invoke swift through PATH, so prepend Xcode Swift before tests; otherwise the static build config plugin may write a Swiftly configuration error instead of JSON.
Hokila
force-pushed
the
fix-macos-ci-xctest
branch
from
September 25, 2026 08:08
85781d9 to
d9e0bb8
Compare
ktoso
approved these changes
Sep 25, 2026
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the macOS Swift CI job reliable: keep Swiftly for the Swift 6.3 production build and use the Xcode toolchain for both test modes.
Problem
The original job failed during Swift Build:
SwiftSyntaxMacrosTestSupport/Assertions.swift:19:16: error: no such module 'XCTest'Failed job: https://github.com/swiftlang/swift-java/actions/runs/35585778520/job/107554476812?pr=922
swift build --build-testsswift build --build-testsBoth runs used the same Swiftly version and build command, but XCTest discovery behaved differently. This shows that relying on XCTest discovery from the Swiftly standalone toolchain is environment-dependent.
Changes
Install Swiftlystep.swift build --disable-sandboxPATHbefore tests so SwiftPM build plugins use the same toolchain.xcrun swift test --disable-xctestxcrun swift test --disable-experimental-swift-testingThe
Swift Buildstep no longer uses--build-tests. SwiftPM still compiles XCTest test targets when--disable-xctestis set, so both test modes use Xcode Swift to make XCTest available. The build plugin also invokesswiftthroughPATH; putting Xcode Swift first prevents it from writing a Swiftly configuration error instead ofstatic-build-config.json.Validation
no such module 'XCTest'with Swiftly 6.3.3 andswift test --disable-xctestin a small package containing XCTest and Swift Testing targets. Both Xcode test modes passed on that package.xcrun swift testinherited a Swiftly-firstPATH; verified that an Xcode-firstPATHproduces valid JSON.PATH:xcrun swift test --disable-xctestpassed 691 Swift Testing tests;xcrun swift test --disable-experimental-swift-testingpassed 117 XCTest tests (1 skipped). Gradle 9.4.0 bootstrapped successfully for the Java integration tests.