Skip to content
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

Add Swift 6 docs #612

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add Swift 6 docs #612

wants to merge 1 commit into from

Conversation

DandyLyons
Copy link

No description provided.

@DandyLyons
Copy link
Author

One of the Swift contributors suspects that we might have found a compiler bug. We should hold off on adding these docs until we've investigated further.

https://forums.swift.org/t/crowd-source-swift-language-modes-in-various-environments/76102/3

@DandyLyons
Copy link
Author

DandyLyons commented Nov 19, 2024

I found the problem thanks to Xiaodi. https://forums.swift.org/t/crowd-source-swift-language-modes-in-various-environments/76102/6

Apparently the default language mode is Swift 6 if you use // swift-tools-version: 6.0 in your Package.swift. See: https://www.swift.org/migration/documentation/swift-6-concurrency-migration-guide/swift6mode/

I'll update this PR to reflect that later.

@migueldeicaza
Copy link
Owner

There is another PR #615 that fixes the build for 6.0, does the documentation here need to be updated, or would it be good to go once we land the other one?

@DandyLyons
Copy link
Author

Currently users can use either Swift 6 tooling or Swift 5 tooling. After PR #615 we would only be able to use Swift 6 tooling, so a lot (probably most) of these new docs in this PR would be irrelevant. However, users would still be able to choose which language mode they want to use for each target.

I'd say once PR #615 is finalized, we can assess what changes this PR needs to be accurate.

@DandyLyons
Copy link
Author

The tl;dr; is that after we require Swift 6 tooling, (after PR #615), then each module in a package will be Swift 6 language mode by default. This could be a very unexpected change, and so the docs should advise people to opt into Swift 5 language mode, and tell them they can opt into Swift 6 when they are ready.

I explored this in greater detail here: https://dandylyons.net/posts/post-26/am-i-using-swift-5-or-6/

Even more confusingly, that is the behavior if SwiftGodot is added as a dependency directly in a Package.swift file. But the behavior is not the same if a package dependency is added through the Xcode GUI.

It's also important to note that Matt Massicote advises that we should NOT use Swift 6 language mode until we have a compelling reason to. (Of course, his opinion isn't infallible, but when he advises on Swift Concurrency, I pay attention. He wrote a huge portion of the official Swift 6 transition guide.)
https://www.youtube.com/watch?v=oMg2OjO3LLI

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.

2 participants