-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Update the Swift version to 6.0! #71707
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
Conversation
@swift-ci test |
@swift-ci build toolchain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The standard library changes look good to me! cc: @lorentey for his input.
fe4a425
to
e8addf5
Compare
@swift-ci test |
@swift-ci build toolchain |
@swift-ci clean test macOS |
CC @compnerd, do we need to update the |
cc @kateinoigakukun for Wasm changes |
e8addf5
to
af112c1
Compare
@swift-ci test Linux |
Don't use `#cmakedefine` to define values that can be zero. `#cmakedefine` only sets the definition when the corresponding value in CMake itself has a truthy value. `0` has a false-y value, so SWIFT_VERSION_MINOR is undefined for 6.0 resulting in some things breaking.
@swift-ci please test |
19d6595
to
2173c52
Compare
swiftlang/swift-experimental-string-processing#722 @swift-ci build toolchain |
I don't think that we should. It would be an unnecessary break. If there was a motivation for doing this, e.g. we are changing the contents of the linker tables, then perhaps. Otherwise, I think that bumping the version is really unnecessary. Particularly on non-Darwin, the collection itself is versioned so that we can continue to add tables without changing the contents. So, even in the case where we want to change the contents, I think that we have other means. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 🚢
swiftlang/swift-experimental-string-processing#722 @swift-ci build toolchain |
This is a follow up to a corresponding toolchain PR swiftlang/swift#71707.
This is a follow up to a corresponding toolchain PR swiftlang/swift#71707.
This is a follow up to a corresponding toolchain PR swiftlang/swift#71707.
This is a follow up to a corresponding toolchain PR swiftlang/swift#71707.
@@ -171,7 +171,7 @@ namespace swift { | |||
/// | |||
|
|||
/// User-overridable language version to compile for. | |||
version::Version EffectiveLanguageVersion = version::Version::getCurrentLanguageVersion(); | |||
version::Version EffectiveLanguageVersion = version::Version{5, 10}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shahmishal, do you plan to bump this to 6 soon? Otherwise, I'm seeing strange behavior like this when compiling code with the Swift 6 snapshots:
> cat check.swift
#if swift(>=6.0)
print("got to 6.0")
#else
print("no go to 6.0")
#endif
> ./swift-DEVELOPMENT-SNAPSHOT-2024-07-29-a-ubi9/usr/bin/swiftc check.swift && ./check
no go to 6.0
> ./swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-02-a-ubi9/usr/bin/swiftc check.swift && ./check
no go to 6.0
Of course, this can be worked around by explicitly setting the language version:
> ./swift-DEVELOPMENT-SNAPSHOT-2024-07-29-a-ubi9/usr/bin/swiftc check.swift -swift-version 6 && ./check
got to 6.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is expected, the Swift 6.0 language mode is not enabled by default. Developers are required to enable Swift 6 language mode by using -swift-version 6.0
https://www.swift.org/migration
Important
The Swift 6 language mode is opt-in. Existing projects will not switch to this mode without configuration changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I now see this was discussed on the forum months ago, which I missed: I will ask about it there.
The Swift 6.0 release process will be announced soon. The
main
branch will be used to track Swift 6.0 untilrelease/6.0
branch has been created.