-
Notifications
You must be signed in to change notification settings - Fork 37.7k
build: improve cxx and linker flag caching #30732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process. ConflictsNo conflicts as of last run. |
516e8d2
to
645809d
Compare
(sorry, wrong button) |
645809d
to
4f06b02
Compare
4f06b02
to
7c1640c
Compare
7c1640c
to
bd0053e
Compare
We'll get keys such as: > LINKER_SUPPORTS__FSANITIZE_UNDEFINED_ADDRESS_FUZZER__WL__FATAL_WARNINGS_A797852B32447D9D3594B7F06EFE65790DAAEFCBEFCE4144D7B1F480F6FA4B6A This change will trigger a recompilation when `working_linker_werror_flag` are changed (instead of a false cache hit)
bd0053e
to
2a97482
Compare
Adding a source hash to the cache variable name became necessary at some point during the development of the CMake staging branch, as checks for the same flags could occur with different sources in a single 2a97482 |
Thanks for checking @hebasto!
There's only a single case where SOURCE is defined now - in which case the related flags were also unique: We could drop the hash, but that means that whoever calls that method again has to change the implementation, since it's not safe to call it without knowing who else called it, right?
Can't this occur on branch changes as well, if one of them has a modification in this area? |
cc @hodlinator |
Migration of hebasto#340
try_append_cxx_flags
andtry_append_linker_flag
are CMake functions used to test and conditionally apply compiler and linker flags to ensure compatibility with the build environment.Currently the only case when the
SOURCE
parameter was overwritten was bitcoin/bitcoin@8b6f1c4/CMakeLists.txt#L383-L389.So currently the values would be unique without the hash, but overwriting a source in the future would cause a false hit, so I kept the full (uppercase) hash - and also added the
werror_flag
to the cache key, since the result of the compilation depends on it as well.After this change we will have logs such as:
On top of that,
try_append_cxx_flags
currently doesn't even need aSOURCE
parameter - I've removed it for now, we can add it back once we need it.