-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Set -user-module-version for any version-based package
#6781
Conversation
|
@swift-ci please smoke test |
|
Unsure whether we should conditionalize this based on tools-version |
probably should for unintended consequences? or is it inert? also should we add a test? |
What is was thinking is that not tying it to the tools version would allow folks to support multiple versions if their users are using a newer SwiftPM, but they would still have support for a singular older version for users of older SwiftPMs. For example, in the case of a Swift macro, I could write something like: where the else block would still work for users of Swift 5.9 who by definition won't be able to use the swift-syntax aligned with 5.10 and therefore couldn't even reach the if anyway. It does come with a certain danger of course, because presumably the package would have a more open ended dependency and it would rely on clients to constraint their dependencies in some way. |
We should, but it doesn't look like the infrastructure of the build plan tests supports it today. The version of any dependency seems to not be set when running those tests. |
|
Ah, it seems like we can just hardcode a version in the |
40de51d
to
3c78b8a
Compare
|
We're currently discussing whether we should bring this into 5.9, so for now I set it to be included for any package with tools-version 5.9 or newer. |
|
@swift-ci please smoke test |
|
@swift-ci please smoke test windows |
wat |
This would allow conditionalizing client code using ``#if canImport(:_version:)`` so that different versions of a dependency can be supported within a single codebase. Note: this is explicitly not passing the flag if pre-releases are in use to avoid any confusion in those cases. rdar://107077287
3c78b8a
to
f2e92ff
Compare
|
@swift-ci please smoke test |
|
@swift-ci please smoke test windows |
This would allow conditionalizing client code using
#if canImport(:_version:)so that different versions of a dependency can be supported within a single codebase.Note: this is explicitly not passing the flag if pre-releases are in use to avoid any confusion in those cases.
rdar://107077287