-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Updating compiler versions (4.1, 3.3, able to do swift-version 5) #11507
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
… to be 3.3 (from 3.2), adding ability to pass swift-version 5. Importer work not done yet.
@swift-ci please test |
@swift-ci please smoke test |
Build failed |
@@ -319,14 +319,16 @@ Optional<Version> Version::getEffectiveLanguageVersion() const { | |||
switch (Components[0]) { | |||
case 3: | |||
#ifdef SWIFT_VERSION_PATCHLEVEL | |||
return Version{3, 2, SWIFT_VERSION_PATCHLEVEL}; | |||
return Version{3, 3, SWIFT_VERSION_PATCHLEVEL}; |
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.
@jrose-apple expressed some concern about moving this to 3.3 because comparisons on version ranges of being greater than 3.2 will encompass 4.0, 5.0, etc. It's something we likely need to handle, but if people are using "> 3.2" to check if it is Swift 4 then bumping the Swift 3 version to "3.3.x" will cause problems.
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.
Good point. Since that part means means rethinking our design of #if swift, I was planning on doing that separately. If folks need to have separate code between 4 and 4.1, they can conditionalize those separately as a workaround. It could lead to some duplication of code and that's why a rethink of #if swift or an introduction of another mechanism might be desirable.
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 for bringing this up, Ted. I think I agree with Ewa that it's better to have something in place that we can modify later. We certainly don't want to continue advertising ourselves as Swift 3.2.
(Further information: we only allow >= checks, so the concern isn't about 3.2 but about 3.3. There's no way to check for "3.3 or 4.1 but not 4.0". This could also be a problem if we do any patch releases of 4.0.)
include/swift/AST/ASTContext.h
Outdated
bool isSwiftVersion4() const { return LangOpts.isSwiftVersion4(); } | ||
|
||
/// Whether our effective Swift version is in the Swift 5 family | ||
bool isSwiftVersion5() const { return LangOpts.isSwiftVersion5(); } |
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.
Actually, I'd rather we not get isSwiftVersion5
. We shouldn't ever be checking it, because any new behaviors should be "5 or newer"
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.
Updated: I don't want isSwiftVersion4
either :) We should be doing <, <=, >, >=, etc. checks against the major version.
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.
Fair point about the <, <=, >, >=. Removing isSwiftVersion4, isSwiftVersion5 from pull request now.
… a better way to conditionalize code based on language version.
@swift-ci smoke test |
@swift-ci please smoke test |
@swift-ci please test |
1 similar comment
@swift-ci please test |
@swift-ci please clean test Linux |
We should also update https://github.com/apple/swift/blob/master/utils/build-script#L2075 to 4.1 |
@shahmishal Updated the build script. |
@swift-ci please smoke test |
Build failed |
@swift-ci please clean test Linux |
This pull request is about updating the versions to reflect the current development on the master branch.
Please note, this does not include the importer work needed to allow APIs to import differently when swift-version 5 is specified.