Skip to content

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

Merged
merged 11 commits into from
Feb 22, 2024
Merged

Update the Swift version to 6.0! #71707

merged 11 commits into from
Feb 22, 2024

Conversation

shahmishal
Copy link
Member

The Swift 6.0 release process will be announced soon. The main branch will be used to track Swift 6.0 until release/6.0 branch has been created.

@shahmishal
Copy link
Member Author

@swift-ci test

@shahmishal
Copy link
Member Author

@swift-ci build toolchain

Copy link
Contributor

@Azoy Azoy left a 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.

@shahmishal shahmishal force-pushed the bump-swift-version-to-6 branch from fe4a425 to e8addf5 Compare February 17, 2024 18:33
@shahmishal
Copy link
Member Author

@swift-ci test

@shahmishal
Copy link
Member Author

@swift-ci build toolchain

@shahmishal
Copy link
Member Author

@swift-ci clean test macOS

@etcwilde
Copy link
Member

@MaxDesiatov
Copy link
Contributor

cc @kateinoigakukun for Wasm changes

@shahmishal shahmishal force-pushed the bump-swift-version-to-6 branch from e8addf5 to af112c1 Compare February 20, 2024 01:48
@shahmishal
Copy link
Member Author

@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.
@etcwilde
Copy link
Member

@swift-ci please test

@shahmishal
Copy link
Member Author

@shahmishal
Copy link
Member Author

@compnerd
Copy link
Member

CC @compnerd, do we need to update the swift5 section names in https://github.com/apple/swift/blob/main/stdlib/public/runtime/SwiftRT-ELF-WASM.cpp and https://github.com/apple/swift/blob/main/stdlib/public/runtime/SwiftRT-COFF.cpp?

We can rename swift5 section names for ABI unstable platforms, but it's not mandatory

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.

@ahoppen ahoppen removed their request for review February 20, 2024 22:05
Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🚢

@shahmishal
Copy link
Member Author

@shahmishal
Copy link
Member Author

@shahmishal
Copy link
Member Author

@shahmishal
Copy link
Member Author

@shahmishal shahmishal merged commit c7c3eb2 into main Feb 22, 2024
@shahmishal shahmishal deleted the bump-swift-version-to-6 branch February 22, 2024 17:45
MaxDesiatov added a commit to swiftlang/swift-package-manager that referenced this pull request Feb 23, 2024
This is a follow up to a corresponding toolchain PR swiftlang/swift#71707.
MaxDesiatov added a commit to swiftlang/swift-package-manager that referenced this pull request Feb 23, 2024
This is a follow up to a corresponding toolchain PR
swiftlang/swift#71707.
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
@@ -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};
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.