chore: Add Git information compile-time info to only one file - #6464
Conversation
ximinez
left a comment
There was a problem hiding this comment.
I don't like requiring git, and requiring the repo to be checked out. It seems unnecessarily restrictive to not support building from the source in a zip file, for example. There are places on Github where one can easily do that: Release pages, the "<> Code" button on the main page, etc. There's no reason to lock those options out.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6464 +/- ##
=========================================
- Coverage 79.8% 79.8% -0.0%
=========================================
Files 858 859 +1
Lines 67766 67785 +19
Branches 7549 7556 +7
=========================================
+ Hits 54091 54094 +3
- Misses 13675 13691 +16
🚀 New features to boost your workflow:
|
ximinez
left a comment
There was a problem hiding this comment.
Thanks for making the changes. This looks great! I can't wait for those faster builds...
…6464) The existing code added the git commit info (`GIT_COMMIT_HASH` and `GIT_BRANCH`) to every file, which was a problem for leveraging `ccache` to cache build objects. This change adds a separate C++ file from where these compile-time variables are propagated to wherever they are needed. A new CMake file is added to set the commit info if the `git` binary is available.
High Level Overview of Change
Previous approach had one big flaw:
I also introduce change of behaviour: we require git to be installed, and to build with git information available. It just makes life easier, because reduces number of cases we need to support.Instead, I added a separate C++ file, where these compile-time variables are propagated and removed all other usages by using functions.
These fixes problems mentioned above.
Note: this PR doesn't change how these variables are calculated.
Context of Change
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)