-
Notifications
You must be signed in to change notification settings - Fork 46
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
Remove no-longer-needed @preconcurrency
s
#83
Conversation
@swift-server-bot test this please |
@MahdiBM |
@MahdiBM let me know when it's ready for a re-review/re-CI 🙂 |
@czechboy0 it should be ready |
@swift-server-bot test this please |
@swift-server-bot test this please |
Hi @MahdiBM, thanks for doing this! Unfortunately I realized we have a gap in our CI story, and that's testing with the 5.9.0 toolchain. The 5.9 pipeline resolves to 5.9.1, which already has the Sendability improvements in corelibs-foundation, but 5.9.0 doesn't. We don't want to require 5.9.1 at the package level, because it wouldn't work with the latest released stable Xcode, so we plan to keep 5.9.0 as the minimum required toolchain to build the project. With that, I opened PRs in all 4 repos to explicitly request 5.9.0 in CI, to ensure we don't accidentally break those users, see, for examples, #84. Once that lands, please update your PRs and hopefully the CI status should reflect whether we can take that change. It's possible that we simply live with the remarks (they're not warnings, are they?) about unnecessary preconcurrency attributes until 5.10 is released, and then we could conditionalize the imports using an #if check for the compiler version – what do you think? |
Hmm right, i did notice that the CI is resolving to 5.9.1. This PR doesn't require or break anything. |
I agree that most people probably use 5.9.1, but we need to follow the documented minimum Swift version we claim to support, which is 5.9.0 on all platforms. Once #84 lands I'll click the Update Branch button on this PR and we'll see what 5.9.0 CI says, if it's all green then of course we can merge it. |
Yes, until a released (not pre-release) Xcode that uses Swift 5.9.1 has been out for a reasonable amount of time, we must support 5.9.0. However, I'm sympathetic that we should be expecting folks to use the latest patch release for Swift 5.9 available for their platform, which, on Linux, is 5.9.1. It's a laudable goal to have compile without any #if canImport(Darwin)
import Foundation
#else // canImport(Darwin)
#if swift(>=5.9.1)
import struct Foundation.... // for all the things that have been fixed up in 5.9.1
...
#else // swift(>=5.9.1)
@preconcurrency import struct Foundation.... // for all the things that have been fixed up in 5.9.1
#endif // swift(>=5.9.1)
import struct Foundation.... // for all the things that we can import without @preconcurrency, even on Swift 5.9.
#endif // canImport(Darwin) |
@swift-server-bot test this please |
So on 5.9.0 we get |
How should we proceed? I'm fine with dropping the PRs if the #if dance doesn't seem worth it 🙂 |
@MahdiBM Up to you, we'd accept the PR if you can get all the CI to green, but won't have time ourselves to get to this for 1.0 🙂 |
@czechboy0 why is 5.9.0 CI is having fatal errors? Is it how the "fail on warning" swift compiler flag works? Because the PR should not have resulted in this 🤔 Edit: nevermind i don't think you have that flag enabled. Another Edit: I see that's enabled in the docker file so my initial suspicion seems correct? |
Yes we build with warnings-as-errors, and I believe missing a |
Right. This is exactly the reason we put the CI in place because, before, with just a 5.9.1 pipeline it looked fine but could produce warnings, which can be promoted to errors when compiled with warnings-as-errors. In this project it won't affect adopters since if warnings-as-errors doesn't apply to dependencies. But, for the generator repo, it can impact adopters because generated code will be subject to the compiler flags the adopter chooses and there's no current way to ignore warnings on a per-file basis like in some other languages. However, for symmetry, and just because we'd like to be warning clean going into 1.0, we'd like to have no warnings on any supported platforms for the repos we maintain. |
@swift-server-bot test this please |
This time it should work for 5.9.0/5.9.1 as i tested locally before pushing |
@swift-server-bot test this please |
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.
Thanks @MahdiBM!
See apple/swift-openapi-generator#396.