Skip to content

Conversation

@Teemperor
Copy link
Contributor

@Teemperor Teemperor commented Jul 26, 2017

This fixes that we often rebuild parts of ROOT by just doing simple git things. Before this change
we had this dependency on the header VCSRevision.h which is used by different parts of LLVM:

interpreter/llvm/src/include/llvm/Support/VCSRevision.h:
  input: CUSTOM_COMMAND
    /home/teemperor/root/root-trunk2/.git/logs/HEAD <- Timestamp of this changes a lot!
    /home/teemperor/root/root-trunk2/interpreter/llvm/src/cmake/modules/GenerateVersionFromCVS.cmake
  outputs:
    interpreter/llvm/src/include/llvm/Support/llvm_vcsrevision_h
    interpreter/llvm/src/include/llvm/Support/CMakeFiles/llvm_vcsrevision_h

After this change we no longer have the git head in here:

teemperor@ftlserver ~/r/trunk-build2> ninja -t query interpreter/llvm/src/include/llvm/Support/VCSRevision.h
interpreter/llvm/src/include/llvm/Support/VCSRevision.h:
  outputs:
    interpreter/llvm/src/include/llvm/Support/CMakeFiles/llvm_vcsrevision_h

I added two commits: One that fixes the current builds in a hacky way and one that is doing it properly but only goes into effect once we have the next LLVM upgrade (as the flag for configuring this is just added recently).

Currently LLVM LTO and other parts depend on the git HEAD file
because they pull in the current git revision (and should update
when the git revision changes). This is causing some unnecessary
rebuilding everytime someone is touching his git HEAD file.

This commit is disabling this in future LLVM versions by setting
the appropriate flag in LLVM to OFF (doesn't do a lot by now
as we first need to get this revision in the ROOT llvm version
https://reviews.llvm.org/D35377).
This removes the file dependency between LLVM and the git HEAD file,
which currently causes that we rebuild LLVM/Cling/Dictionaries
once someone does anything meaningful in git.
@phsft-bot
Copy link

Starting build on centos7/gcc49, mac1012/native, slc6/gcc49, slc6/gcc62, ubuntu14/native with flags -Dvc=OFF -Dimt=ON -Dccache=ON
How to customize builds

# Ugly hack to prevent rebuilding LLVM whenever the git HEAD timestamp
# changes. This is properly solved by setting LLVM_APPEND_VC_REV to OFF
# but this only really works once this review is included in our LLVM
# version: https://reviews.llvm.org/D35377
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we backport it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's multiple commits that refactored this thing, D35377 is only the one that actually makes it fully work as intended (we don't even have the setting variable he's using in our CMake code yet), and backporting bigger pieces of CMake code isn't a lot of fun.

It's also just until the next LLVM upgrade where the other commit fixes this properly and we can drop this hack.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable to me, thanks for explaining.

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.

3 participants