4tXJ7f / cvc5

CVC4 is an efficient open-source automatic theorem prover for satisfiability modulo theories (SMT) problems.
Other
2 stars 5 forks source link

When configuring 'git_versioninfo.cpp', do not always overwrite the file we compile; generate a temporary file, and only overwrite if it is has changed #21

Closed aytey closed 4 years ago

aytey commented 4 years ago

Attempt to ensure we don't have unnecessary compiles.

We want to see:

[4/513] cd /home/avj/clones/CVC4/git_info/bui...2/bin/cmake -DGIT_FOUND=TRUE -P GitInfo.cmake
Files "git_versioninfo.cpp.curr" to "git_versioninfo.cpp" are different.

Signed-off-by: Andrew V. Jones andrew.jones@vector.com

aytey commented 4 years ago

My initial testing (e.g., changing between branches) causes git_versioninfo.cpp to be overwritten (correctly). If I don't change branches, and do an incremental build, then git_versioninfo.cpp isn't touched (so no compiles happen).

aytey commented 4 years ago

Looks like it works:

[avj@tempvm build]$ ninja
[1/8] cd /home/avj/clones/CVC4/git_info/build/src/base && /home/BUILD64/bin/cmake-3.17.2/bin/cmake -DGIT_FOUND=TRUE -P GitInfo.cmake
[avj@tempvm build]$ ninja
[1/8] cd /home/avj/clones/CVC4/git_info/build/src/base && /home/BUILD64/bin/cmake-3.17.2/bin/cmake -DGIT_FOUND=TRUE -P GitInfo.cmake
[avj@tempvm build]$ git checkout -b I_am_a_new_branch
Switched to a new branch 'I_am_a_new_branch'
[avj@tempvm build]$ ninja
[1/8] cd /home/avj/clones/CVC4/git_info/build/src/base && /home/BUILD64/bin/cmake-3.17.2/bin/cmake -DGIT_FOUND=TRUE -P GitInfo.cmake
Files "git_versioninfo.cpp.curr" to "git_versioninfo.cpp" are different.
[8/8] Linking CXX shared library src/main/libmain-test.so
[avj@tempvm build]$ ninja
[1/8] cd /home/avj/clones/CVC4/git_info/build/src/base && /home/BUILD64/bin/cmake-3.17.2/bin/cmake -DGIT_FOUND=TRUE -P GitInfo.cmake