-
Notifications
You must be signed in to change notification settings - Fork 43
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
Switch up compiler directives for concurrency #111
Conversation
Can one of the admins verify this patch? |
7 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
@swift-server-bot test this please |
@ktoso is this the right approach? |
Seeing as CI is failing, I assume the tests are all running on an OS where |
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 partially correct.
-
We should remove any mention of
import _Concurrency
at all; completely. This module is imported automatically when it exists. It should not be imported explicitly - it just adds more noise to the project. -
The
#if
guard IS correct though for guarding any code actually using async/Concurrency, we can't just detect the swift version but have to guard with the concurrency import availability as well.
Would you mind changing the PR to remove the imports? Then it's LGTM :)
Once Monterey is out should we still be checking for existence of _Concurrency. Is this a temporary fix until that point? |
For now assume it'll be around. |
Great, thanks @ktoso. Updated. |
@swift-server-bot test this please |
thanks for the PR @joshuawright11, something does not seem to be correct with the conditions give the CI failures in > 5.2 < 5.5 version. have not tried to compile this but perhaps replace
with
|
Something is indeed weird here... I was checking with the compiler team if these are the guards we should use and we think those are right 🤔 |
I had trouble composing them in the past, hence the guards |
Yeah it does seem like something odd is going on, I poked around with the complex #if statements on my machine and it worked fine; though my machine is also 5.5 so perhaps it's an issue with older swift versions. Alas, #if compiler(<5.2)
return
#elseif compiler(<5.5)
throw XCTSkip()
#elseif !canImport(_Concurrency)
throw XCTSkip()
#else
...
#endif Let's see if it likes that. |
@swift-server-bot test this please |
fyi you can run the tests we run in CI locally using docker, see the docker-compose files |
nightly CI failure expected due to @sendable changes |
This may be misguided, see comments in #110