-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[6.0] Handle Swift versions unsupported by XCBuild #7504
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
Merged
neonichu
merged 1 commit into
release/6.0
from
handle-swift-versions-unsupported-by-xcbuild-6.0
Apr 26, 2024
Merged
[6.0] Handle Swift versions unsupported by XCBuild #7504
neonichu
merged 1 commit into
release/6.0
from
handle-swift-versions-unsupported-by-xcbuild-6.0
Apr 26, 2024
Conversation
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
XCBuild has its own notion of supported Swift versions which can differ from the ones SwiftPM's own build system and the used compiler support. Using a version outside of the supported range prevents building, so we'll try to obtain the list of supported versions and intersect it with the versions supported by a given package to find the best version supported by both. (cherry picked from commit 3f9587c)
@swift-ci please test |
bnbarham
approved these changes
Apr 26, 2024
ahoppen
added a commit
to ahoppen/swift-package-manager
that referenced
this pull request
May 9, 2024
This shouldn’t be needed anymore with swiftlang#7504.
ahoppen
added a commit
that referenced
this pull request
May 14, 2024
This shouldn’t be needed anymore with #7504.
ahoppen
added a commit
to ahoppen/swift-package-manager
that referenced
this pull request
May 14, 2024
This shouldn’t be needed anymore with swiftlang#7504.
ahoppen
added a commit
that referenced
this pull request
May 14, 2024
* **Explanation**: Remove code that forced swift-syntax to be built in Swift 5 mode because the underlying issue was fixed by #7504 * **Scope**: Building SwiftPM * **Risk**: Low, if there are any issues, they will be caught at build time * **Testing**: Checked that SwiftPM still builds * **Issue**: n/a * **Reviewer**: @bnbarham on #7545
furby-tm
pushed a commit
to wabiverse/swift-package-manager
that referenced
this pull request
May 15, 2024
This shouldn’t be needed anymore with swiftlang#7504.
furby-tm
pushed a commit
to wabiverse/swift-package-manager
that referenced
this pull request
May 15, 2024
This shouldn’t be needed anymore with swiftlang#7504.
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.
XCBuild has its own notion of supported Swift versions which can differ from the ones SwiftPM's own build system and the used compiler support. Using a version outside of the supported range prevents building, so we'll try to obtain the list of supported versions and intersect it with the versions supported by a given package to find the best version supported by both.
(cherry picked from commit 3f9587c)
Explanation: XCBuild has its own notion of supported Swift versions that can be different from the toolchain/SwiftPM. To support packages that support multiple language versions, including Swift 6, we need to allow falling back to an older language version if the newest supported one is not supported by XCBuild.
Scope: Anyone using XCBuild from existing Xcodes together with a Swift 6 toolchain, specifically we're running into this when adopting Swift 6 in swift-syntax since the macOS toolchain build uses XCBuild to produce universal binaries.
Issue: rdar://126952308 (Building a package that supports Swift 6 mode using a Swift 6 toolchain but with a RainbowE Xcode fails with:
SWIFT_VERSION '6' is unsupported, supported versions are: 4.0, 4.2, 5.0
)Original PR: #7499
Risk: Low risk
Testing: Manually tested with a few different Xcodes, added a unit test for the specific scenario.
Reviewer: @MaxDesiatov