-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Introduce availability macros #39962
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
The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib. Adjust the definition of the SwiftStdlib availability macro accordingly.
The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib. Adjust macro usages accordingly.
@swift-ci test |
Build failed |
Fascinating:
The code is: @available(SwiftStdlib 5.1, *)
public protocol DistributedActor:
AnyActor, Sendable, Identifiable, Hashable, Codable {
...
} AFAICT the Distributed module does not define any availability macros, so both @ktoso How does |
Discussed offline: the thing is defined in |
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.
LGTM, Distributed should likely be really defined for 9999
so maybe you can do this? Thanks !
The _Distributed module is being introduced in Swift 5.6, so its definitions need to come with matching availability. (We don't have version numbers for the associated OS releases, so we need to use placeholder 9999 availability for these.)
Yep, I accidentally removed the The latest commit (temporarily) restores it and updates everything in |
@swift-ci test |
(The restoration is temporary as all these SwiftStdlib definitions (and more) will get moved to the top-level CMakeLists.txt soon.) |
Ugh, there will be a couple of test failures at least, as the tests only see |
Build failed |
Yep, as expected:
|
SwiftStdlib 5.5
⟹ SwiftStdlib 5.1
Introduce "SwiftStdlib x.y"-style availability macros for all known releases of the stdlib, adding them to the swift flags of all Swift libraries and tests.
30d5735
to
2732765
Compare
… test/Distributed
This comment has been minimized.
This comment has been minimized.
899660d
to
4a48a17
Compare
4a48a17
to
b6f0b6d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 looks good! Thanks for refactoring the macros definition, it's much cleaner.
This comment has been minimized.
This comment has been minimized.
The Windows build timed out. |
This comment has been minimized.
This comment has been minimized.
D'oh |
@swift-ci test |
Define the following availability macros throughout all Swift libraries and tests in this repository:
These correspond to previous Swift Stdlib releases, in addition to the "5.6" release that we're currently working on, and the a placeholder "9999" release that we can use in place of an unknown future Swift release.
As part of this, we need to replace the pre-existing
SwiftStdlib 5.5
macro defined in the_Concurrency
module with the correctSwiftStdlib 5.1
, so that its expansion matches our release history. (The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib. Before this PR, this was reflected in the expansion ofSwiftStdlib 5.5
, but not its name.)The new module
_Distributed
also definesSwiftStdlib 5.5
, but its declarations need to have availability corresponding to the future Swift 5.6 release -- so this PR replaces it withSwiftStdlib 5.6
.To keep this PR (relatively) small, it does not include changes necessary to adopt these macros in existing stdlib code. (Beyond cleaning up the
_Concurrency
vs_Distributed
situation.)