Repository navigation
build(swift): pin local builds to Xcode's toolchain - #8
Merged
Merged
Conversation
swiftly shims `swift` to whichever swift.org toolchain is the user's default, and no swift.org toolchain can build this package. grpc-swift-protobuf's codegen plugin fails to resolve Foundation's `Data` and `URL` against the macOS SDK, and swift-protobuf fails the same way behind it. Reproduced here on 6.2.1; the identical failure in flipcash2-client-protocol also reproduced on 6.3.3, so it is not a stale default. Apple's Swift 6.4 from Xcode builds it clean in ten seconds. CI already runs bare `swift build` on macos-15 against Xcode's toolchain, in both ci.yml and publish.yml, so this only makes a local checkout match what CI does. swiftly is the only thing that reads `.swift-version`, so CI and contributors without swiftly are unaffected. Same one-line fix as flipcash2-client-protocol 4b600ef.
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.
swift buildfails in a fresh clone of this repo if yourswiftcomes from swiftly. The first error is in grpc-swift-protobuf's codegen plugin:then swift-protobuf fails the same way behind it.
PluginUtils.swiftdoesimport Foundationon line 17, so it is not a missing import — it is the open-source Foundation not lining up with the macOS SDK.It is not a stale toolchain default either. I hit this in
flipcash2-client-protocolfirst and tried 6.2.1 and 6.3.3; both fail identically. Apple's Swift 6.4 from Xcode builds this package clean in ten seconds.So the fix is to stop swiftly answering for
swifthere..swift-versioncontainingxcodedoes exactly that, and nothing else reads the file — swiftly is the only consumer, so a contributor without swiftly and CI both see no change. CI is already on Xcode's toolchain:ci.yml:87andpublish.yml:82run bareswift buildonmacos-15. This only makes a local checkout match what CI was already doing.Same one-line fix as flipcash2-client-protocol@4b600ef, which is on #16. Both repos had it; that one is fixed as part of its contract sync, this one needed its own PR.
scripts/toolchain.envis untouched — the generator pins are a separate thing from which compiler builds the package.