Closed wdconinc closed 5 years ago
After merging #47 this still rebuilds QwRunCondition and QwOptions due to gitinfo (but not the dictionaries).
Test cases:
make -C build
(without changes) must not trigger compilationtouch Parity/main/QwParity.cc && make -C build
must trigger compilationgit pull && make -C build
must trigger compilation only when git pull did somethingSee feature-git-info-in-cmake branch for work towards achieving this. It gets rid of the python script (and dependency) and does everything in CMake. It puts all the changing info in a global in a separate cc file to remove any compile-time dependencies in other files (they are just expected to exist at link-time).
Issues left:
check_git_repository
target not automatically called every timemake check_git_repository
, gitinfo.cc
is created but not automatically compiled (even though it's in my_project_sources...)libQwAnalysis.so: undefined reference to gGitInfo
Fine, this (https://github.com/JeffersonLab/japan/tree/feature-git-info-in-cmake) is as far as I am going to push it. No recompiles on repeated make (but checks git status). Recompiles only git info object file when git info changes (e.g. touch file).
16:15:07 wdconinc@herakles ~/git/japan/build $ make
[ 10%] Built target evio
[ 89%] Built target QwAnalysis
[ 91%] Built target qwparity_simple
[ 92%] Checking the git repository for changes...
-- Git status unchanged
[ 92%] Built target check_git_repository
[ 95%] Built target qwmockdatagenerator
[ 97%] Built target qwroot
[100%] Built target qwparity
16:15:09 wdconinc@herakles ~/git/japan/build $ make -j 4
[ 1%] Checking the git repository for changes...
[ 11%] Built target evio
-- Git status unchanged
[ 11%] Built target check_git_repository
[ 90%] Built target QwAnalysis
[ 92%] Built target qwroot
[100%] Built target qwparity_simple
[100%] Built target qwmockdatagenerator
[100%] Built target qwparity
16:15:11 wdconinc@herakles ~/git/japan/build $ touch ../file
16:15:15 wdconinc@herakles ~/git/japan/build $ make
[ 10%] Built target evio
[ 89%] Built target QwAnalysis
[ 91%] Built target qwparity_simple
[ 92%] Checking the git repository for changes...
-- Git status has changed
[ 92%] Built target check_git_repository
[ 95%] Built target qwmockdatagenerator
[ 97%] Built target qwroot
[100%] Built target qwparity
16:15:16 wdconinc@herakles ~/git/japan/build $ make
[ 10%] Built target evio
Scanning dependencies of target QwAnalysis
[ 11%] Building CXX object CMakeFiles/QwAnalysis.dir/gitinfo.cc.o
[ 12%] Linking CXX shared library libQwAnalysis.so
[ 89%] Built target QwAnalysis
[ 90%] Linking CXX executable qwparity_simple
[ 91%] Built target qwparity_simple
[ 92%] Checking the git repository for changes...
-- Git status unchanged
[ 92%] Built target check_git_repository
[ 94%] Linking CXX executable qwmockdatagenerator
[ 95%] Built target qwmockdatagenerator
[ 96%] Linking CXX executable qwroot
[ 97%] Built target qwroot
[ 98%] Linking CXX executable qwparity
[100%] Built target qwparity
Note: As you see above, there's a lag of one compile cycle: if the git info is changed now, the first compile will update gitinfo.cc but that will not get included in the library until the next build... You can either make the git checking a top level dependency that is always called, or you can have it be a dependency of something else but then it can't be called every time.
I am calling it quits on this issue, though, it's already a lot better the when I started.
First question: is this just on my machine or does this happen elsewhere too?
I think I've fixed this elsewhere... May also be related to pulling gitinfo.