Skip to content

Don't include revisions in --version output by default #2105

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

Closed

Conversation

jrose-apple
Copy link
Contributor

New build-script-impl option swift-include-revisions-in-version, which controls whether revision numbers show up in --version output. Turning this on results in the compiler being rebuilt every time the current checked-out revision changes, which then results in the standard library being rebuilt unnecessarily. The default is off.

As far as the standard presets go, this is turned on for non-incremental buildbot builds and package builds, and off in incremental buildbot builds.

Present for @dabrahams.


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

Previously, any commit or rebase would force a re-link of the compiler to pick up
the updated version number, even if nothing in the compiler changed. That in turn
forces an unnecessary rebuild of the standard library.

Now, you can opt into this behavior with the build-script-impl option
'swift-include-revisions-in-version' (it's off by default). When not turned on,
no revision numbers will be shown in --version output.  As far as the standard
presets go, this is turned on for non-incremental buildbot builds and package
builds, and off in incremental buildbot builds.
@jrose-apple
Copy link
Contributor Author

Low-priority review request for @gribozavr.

@swift-ci Please smoke test

@practicalswift
Copy link
Contributor

@jrose-apple Thank you! I've been thinking about fixing this for quite a while! Thanks for doing it! :-)

@dabrahams
Copy link
Contributor

on Fri Apr 08 2016, Jordan Rose <notifications-AT-i.8713187.xyz> wrote:

New build-script-impl option swift-include-revisions-in-version, which controls
whether revision numbers show up in --version output. Turning this on results in
the compiler being rebuilt every time the current checked-out revision changes,
which then results in the standard library being rebuilt unnecessarily. The
default is off.

As far as the standard presets go, this is turned on for non-incremental
buildbot builds and package builds, and off in incremental buildbot builds.

Present for @dabrahams.

My hero!

Thanks.

Dave

@jrose-apple
Copy link
Contributor Author

I'm afraid I'll have to betray you all; Dmitri reminded me that this version string is used to avoid reusing the Clang module cache when something has changed. That means that changing the importer could result in crashes.

I could still add this and just have it on by default, but I'm reluctant to even allow turning it off. The most likely symptom of a stale Clang module cache is crashes in clang::ASTReader, but it could also result in changed apinotes or import strategies not being applied, which means tests would just inexplicably fail locally.

I think this needs a cleverer solution.

@jrose-apple jrose-apple closed this Apr 8, 2016
@jrose-apple
Copy link
Contributor Author

I'll leave the branch around for a while in case anyone wants to do something with it.

@gparker42
Copy link
Contributor

Dmitri reminded me that this version string is used to avoid reusing the Clang module cache when something has changed.

Can you add such a comment to the current version code, so that we aren't tempted to remove it again later while Dmitri isn't looking?

@jrose-apple jrose-apple mentioned this pull request May 5, 2016
1 task
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.

5 participants