This is an archive of the discontinued LLVM Phabricator instance.

Completelly disable git/svn version checking if not needed
ClosedPublic

Authored by rafael on Jun 23 2017, 9:31 AM.

Details

Reviewers
pcc
Summary

Working with git on a branch I find it really annoying that committing a change causes ninja to think that stuff needs to be rebuilt.

With this change at least nothing in llvm needs to be rebuild when something is committed.

I am not sure if this is the right variable to use. Should I add a new cmake option?

Diff Detail

Event Timeline

rafael created this revision.Jun 23 2017, 9:31 AM
pcc edited edge metadata.Jun 23 2017, 9:50 AM
pcc added a subscriber: beanz.

Using LLVM_APPEND_VC_REV seems fine to me, but we probably want to update the documentation and most likely change the default because right now the VC revision affects ThinLTO cache invalidation, and we shouldn't silently use stale cache entries when clang is upgraded.

@beanz any thoughts?

Updated the default and the docs.

pcc accepted this revision.Jun 30 2017, 11:03 AM

LGTM

This revision is now accepted and ready to land.Jun 30 2017, 11:03 AM
vitalybuka added inline comments.
CMakeLists.txt
209

New default slowed down many build bots which relied on incremental build.

rnk added a subscriber: rnk.Aug 29 2017, 11:51 AM
In D34560#789101, @pcc wrote:

Using LLVM_APPEND_VC_REV seems fine to me, but we probably want to update the documentation and most likely change the default because right now the VC revision affects ThinLTO cache invalidation, and we shouldn't silently use stale cache entries when clang is upgraded.

@beanz any thoughts?

I think we can revert the change to the default value of LLVM_APPEND_VC_REV. The VCS revision doesn't need to be included in LLVM_VERSION_STRING because ThinLTO includes VCSRevision.h to add LLVM_REVISION into the hash.

pcc added a comment.Aug 29 2017, 12:48 PM
In D34560#855667, @rnk wrote:
In D34560#789101, @pcc wrote:

Using LLVM_APPEND_VC_REV seems fine to me, but we probably want to update the documentation and most likely change the default because right now the VC revision affects ThinLTO cache invalidation, and we shouldn't silently use stale cache entries when clang is upgraded.

@beanz any thoughts?

I think we can revert the change to the default value of LLVM_APPEND_VC_REV. The VCS revision doesn't need to be included in LLVM_VERSION_STRING because ThinLTO includes VCSRevision.h to add LLVM_REVISION into the hash.

I thought that the purpose of this change was to make thinlto use LLVM_APPEND_VC_REV to control whether to add the VCS revision to the hash. Or do you think there should be a separate CMake variable to control whether thinlto uses the VCS revision?

rnk added a comment.Aug 29 2017, 1:54 PM
In D34560#855735, @pcc wrote:

I thought that the purpose of this change was to make thinlto use LLVM_APPEND_VC_REV to control whether to add the VCS revision to the hash. Or do you think there should be a separate CMake variable to control whether thinlto uses the VCS revision?

I think I see what happened now.

LLVM_APPEND_VC_REV was a dormant option that probably nobody was using. The effect of that option was to add the revision to LLVM_VERSION_STRING in llvm-config.h, which causes llvm-config.h to change after every git commit. This is, IMO, completely undesirable.

Because that functionality was disabled by default, you and others (Jordan?) created VCSRevision.h and the things that came before it to compute accurate version information as part of the build. Rafael didn't want actions to run after changing git branches, so he wrote this patch to put the behavior under this flag. Because you requested the default to change, now everyone is getting the unintended updates to llvm-config.h, causing much larger rebuilds.

However, nobody noticed for months, because cmake caches option settings when it builds. In order to observe the new LLVM_APPEND_VC_REV default value, you have to delete CMakeCache.txt.

I think the default behavior should go back to what it was before this change, where LLVM_REVISION is incorporated into the ThinLTO hash, and we don't have a full rebuild after every cmake run. I'll send a patch.

rnk added a comment.Aug 29 2017, 1:57 PM

Oh, right, I sent it already, it's D37272.

pcc added a comment.Aug 29 2017, 2:17 PM
In D34560#855831, @rnk wrote:
In D34560#855735, @pcc wrote:

I thought that the purpose of this change was to make thinlto use LLVM_APPEND_VC_REV to control whether to add the VCS revision to the hash. Or do you think there should be a separate CMake variable to control whether thinlto uses the VCS revision?

I think I see what happened now.

LLVM_APPEND_VC_REV was a dormant option that probably nobody was using. The effect of that option was to add the revision to LLVM_VERSION_STRING in llvm-config.h, which causes llvm-config.h to change after every git commit. This is, IMO, completely undesirable.

Because that functionality was disabled by default, you and others (Jordan?) created VCSRevision.h and the things that came before it to compute accurate version information as part of the build. Rafael didn't want actions to run after changing git branches, so he wrote this patch to put the behavior under this flag. Because you requested the default to change, now everyone is getting the unintended updates to llvm-config.h, causing much larger rebuilds.

However, nobody noticed for months, because cmake caches option settings when it builds. In order to observe the new LLVM_APPEND_VC_REV default value, you have to delete CMakeCache.txt.

Ouch, sorry about that. Somehow I never noticed this, presumably because I didn't create a new build directory recently.