Skip to content

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

Merged
merged 3 commits into from
Aug 19, 2017

Conversation

ematejska
Copy link
Contributor

This pull request is about updating the versions to reflect the current development on the master branch.

  • Making master call itself 4.1
  • Updating the swift 3 compatiblity mode to be 3.3 (from 3.2)
  • Adding ability to pass swift-version 5 to allow for Swift 5 development to start. This includes providing the isSwiftVersion4, isSwiftVersion5 utility methods.

Please note, this does not include the importer work needed to allow APIs to import differently when swift-version 5 is specified.

… to be 3.3 (from 3.2), adding ability to pass swift-version 5. Importer work not done yet.
@ematejska
Copy link
Contributor Author

@swift-ci please test

@ematejska
Copy link
Contributor Author

@swift-ci please smoke test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1272cd3

@@ -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};
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.)

bool isSwiftVersion4() const { return LangOpts.isSwiftVersion4(); }

/// Whether our effective Swift version is in the Swift 5 family
bool isSwiftVersion5() const { return LangOpts.isSwiftVersion5(); }
Copy link
Member

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"

Copy link
Member

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.

Copy link
Contributor Author

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.
@ematejska
Copy link
Contributor Author

@swift-ci smoke test

@ematejska
Copy link
Contributor Author

@swift-ci please smoke test

@ematejska
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@ematejska
Copy link
Contributor Author

@swift-ci please test

@shahmishal
Copy link
Member

@swift-ci please clean test Linux

@shahmishal
Copy link
Member

@ematejska
Copy link
Contributor Author

@shahmishal Updated the build script.

@ematejska
Copy link
Contributor Author

@swift-ci please smoke test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 93786d8

@shahmishal
Copy link
Member

@swift-ci please clean test Linux

@ematejska ematejska merged commit a7b27a5 into swiftlang:master Aug 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants