Skip to content

Add a switch to not include git commit hash in the built artifacts #32998

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 5 commits into from
Jul 22, 2020

Conversation

hlopko
Copy link
Contributor

@hlopko hlopko commented Jul 20, 2020

This PR adds a SWIFT_APPEND_VC_REV Cmake option (in symmetry with LLVM's LLVM_APPEND_VC_REV).

When enabled, lib/Basic/SwiftRevision.inc header contains git commit hash and repository information, e.g.

#define SWIFT_REVISION "ed4cef9b839d4a87618758d8b8705ab66b61917f"
#define SWIFT_REPOSITORY "https://github.com/scentini/swift.git"

This is useful for keeping track of the VCS state that produced a binary. But for local development builds, this information is often ignored and since this file is invalidated by every git commit or git checkout command and it leads to long rebuilds, it's useful to have a switch to disable this behavior. When SWIFT_APPEND_VC_REV is disabled, lib/Basic/SwiftRevision.inc contains:

#undef SWIFT_REVISION
#undef SWIFT_REPOSITORY

@hlopko
Copy link
Contributor Author

hlopko commented Jul 20, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - aa8b9da

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - aa8b9da

@hlopko hlopko requested review from gribozavr and scentini July 20, 2020 13:50
@hlopko hlopko marked this pull request as ready for review July 20, 2020 13:50
@gribozavr gribozavr requested a review from compnerd July 20, 2020 14:15
@hlopko
Copy link
Contributor Author

hlopko commented Jul 21, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - aa8b9da

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - aa8b9da

@hlopko
Copy link
Contributor Author

hlopko commented Jul 22, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - a526f73

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a526f73

@hlopko hlopko removed the request for review from scentini July 22, 2020 11:48
@hlopko
Copy link
Contributor Author

hlopko commented Jul 22, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 2e0836b

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2e0836b

@hlopko
Copy link
Contributor Author

hlopko commented Jul 22, 2020

@swift-ci please test

@hlopko hlopko merged commit 3e6199b into swiftlang:master Jul 22, 2020
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