-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add the missing StrictConcurrency upcoming feature flag #65993
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 please smoke test |
+1 from me on this. I would love to enable this experimental feature on all our Swift on Server libraries to avoid regressing here. |
Yeah additional context here is that this was discussed in the SSWG and it seems to be a missing feature. I'm trying to get more clarity on this and see if that's the right fix or something else should be done. Thank you for the PR @gwynne |
The absence of an upcoming feature flag for |
What I'm trying to avoid here is having |
Can we make it an experimental feature then? Just making opt-in easier would go a long way even if it is only used in CI builds. |
@FranzBusch I went to try to make it an experimental feature then, but I saw that I have to mark whether or not it's "available in production"; if I don't, it won't work in release builds and thus doesn't solve the problem for package maintainers that this PR was created to address. If I do, we'll run afoul of this notation in the code when we later want to it an upcoming feature: I'm open to suggestions on this one. |
We need something like this to exist in the short term (ideally 5.9!); we need to be able to enforce the strictest available concurrency checking and still have the package consumable by others. It could simply be allowed at the SPM level — have a Or just use a different name and an experimental feature here that won't clash with the future, so we can |
It's fine to make it an experimental feature that's available in production. And we can probably extend the grammar a bit to deal with |
I'll take a whack at this |
Superseded by #66991, thanks @DougGregor and @FranzBusch! |
SE-0362 § Proposals define their own feature identifier claims that an upcoming feature flag named
StrictConcurrency
exists and is equivalent to the-strict-concurrency=complete
compiler flag. However, such a feature flag does not currently exist.This is a problem for package maintainers attempting to add
Sendable
correctness to their own packages. Enabling full checking currently means either always building from the command line with-Xswiftc -strict-concurrency=complete
setting manually specified or adding it to theswiftSettings
for the appropriate target(s) in the package manifest. The former is easily forgotten, and the latter makes the package unusable as a dependency due to the use of "unsafe" flags. Allowing the use of.enableUpcomingFeature("StrictConcurrency")
instead solves both issues.As such, this PR adds the missing upcoming feature. As "unknown" upcoming feature names are silently ignored by the compiler, there are no backwards compatibility concerns.