Skip to content

Rdar 28786959 3.0 branch if swift 3 digit version #5482

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

graydon
Copy link
Contributor

@graydon graydon commented Oct 26, 2016

Cherry-pick of PR against master: #5440

Initial PR description:

Two changes, close relatives.

First change enables writing #if swift(>=3.0.1) by contextually inhibiting an early diagnostic in the parser that's currently blocking the initial semi-parse that runs before the Version parser kicks in.

Second change weakens our sense of logical order and logical equality on Version structures such that 4 == 4.0 == 4.0.0 (that is, versions are considered to have as many trailing zeroes as necessary). The function evaluating versions you are allowed to pass on the command line is tightened opposite this change, so you still can't say -swift-version 4.0 (only -swift-version 4) but it means that if someone writes #if swift(>=4.0) it'll work, rather than the current behaviour, that thinks 4 < 4.0.

Resolves SR-2908.

@graydon
Copy link
Contributor Author

graydon commented Oct 26, 2016

@swift-ci please smoke test

@ematejska
Copy link
Contributor

@swift-ci please test os x

@ematejska ematejska merged commit 3c260bb into swiftlang:swift-3.0-branch Oct 26, 2016
@lattner
Copy link
Contributor

lattner commented Oct 27, 2016

Thanks @graydon !

@shahmishal
Copy link
Member

@graydon Can you please check if this failure is related to this PR? Thanks!

https://ci.swift.org/view/swift-3.0-branch/job/oss-swift-3.0-incremental-RA-linux-ubuntu-14_04/315/consoleFull#-1080512551fca400bf-2f4a-462e-b517-e058d770b2d7

Script:
--
/home/buildnode/jenkins/workspace/oss-swift-3.0-incremental-RA-linux-ubuntu-14_04/buildbot_incremental/swift-linux-x86_64/bin/swift -frontend -target x86_64-unknown-linux-gnu  -parse -verify -disable-objc-attr-requires-foundation-module /home/buildnode/jenkins/workspace/oss-swift-3.0-incremental-RA-linux-ubuntu-14_04/swift/test/Parse/ConditionalCompilation/language_version.swift
--
Exit Code: 1

Command Output (stderr):
--
/home/buildnode/jenkins/workspace/oss-swift-3.0-incremental-RA-linux-ubuntu-14_04/swift/test/Parse/ConditionalCompilation/language_version.swift:55:3: error: unexpected error produced: use of unresolved identifier 'asdf'
  asdf asdf asdf asdf
  ^
/home/buildnode/jenkins/workspace/oss-swift-3.0-incremental-RA-linux-ubuntu-14_04/swift/test/Parse/ConditionalCompilation/language_version.swift:55:7: error: unexpected error produced: consecutive statements on a line must be separated by ';'
  asdf asdf asdf asdf
      ^
/home/buildnode/jenkins/workspace/oss-swift-3.0-incremental-RA-linux-ubuntu-14_04/swift/test/Parse/ConditionalCompilation/language_version.swift:55:8: error: unexpected error produced: use of unresolved identifier 'asdf'
  asdf asdf asdf asdf
       ^
/home/buildnode/jenkins/workspace/oss-swift-3.0-incremental-RA-linux-ubuntu-14_04/swift/test/Parse/ConditionalCompilation/language_version.swift:55:12: error: unexpected error produced: consecutive statements on a line must be separated by ';'
  asdf asdf asdf asdf
           ^
/home/buildnode/jenkins/workspace/oss-swift-3.0-incremental-RA-linux-ubuntu-14_04/swift/test/Parse/ConditionalCompilation/language_version.swift:55:13: error: unexpected error produced: use of unresolved identifier 'asdf'
  asdf asdf asdf asdf
            ^
/home/buildnode/jenkins/workspace/oss-swift-3.0-incremental-RA-linux-ubuntu-14_04/swift/test/Parse/ConditionalCompilation/language_version.swift:55:17: error: unexpected error produced: consecutive statements on a line must be separated by ';'
  asdf asdf asdf asdf
                ^
/home/buildnode/jenkins/workspace/oss-swift-3.0-incremental-RA-linux-ubuntu-14_04/swift/test/Parse/ConditionalCompilation/language_version.swift:55:18: error: unexpected error produced: use of unresolved identifier 'asdf'
  asdf asdf asdf asdf
                 ^

--

@graydon
Copy link
Contributor Author

graydon commented Oct 27, 2016

@shahmishal yes, that is caused by the linux host being set to Swift version: 3.0 rather than 3.0.1, which the test implicitly relies on. I apologize, I didn't realize linux wasn't calling itself 3.0.1 yet.

I've filed #5495 to fix. Not sure what the protocol is wrt. authorization to apply such a fix.

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.

4 participants