-
Notifications
You must be signed in to change notification settings - Fork 99
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
Cache misses with ccache when pcg-cpp is included, possibly due to __DATE__ and __TIME__ #59
Comments
I just verified that making |
I would also highly appreciate having a way to configure out the static arbitrary seed, since it also breaks precompiled headers. |
I agree this should be disabled by default because you have no idea that simply using PCG will reduce the efficiency of compilation caching (which is extremely useful on large codebases). On Arrow C++ this probably has cost us many hours of CI time without us knowing. |
### Rationale for this change The PCG headers use the `__DATE__` and `__TIME__` macros, which makes builds non-deterministic: imneme/pcg-cpp#59 Deterministic builds are useful for a number of reasons. One is security audits of binary artifacts, another (that directly affects us) is making compilation caching as efficient as possible. Preprocessor-based compilation caching breaks when time-dependent macros are used. ### What changes are included in this PR? Remove the `struct static_arbitrary_seed` construct from PCG. Also, enable a gcc/clang warning that detects the use of non-deterministic preprocessor macros. ### Are these changes tested? Yes, by the additional warning (which is turned into an error in "checkin" warnings mode). ### Are there any user-facing changes? No. * Closes: #35596 Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
…e#35597) ### Rationale for this change The PCG headers use the `__DATE__` and `__TIME__` macros, which makes builds non-deterministic: imneme/pcg-cpp#59 Deterministic builds are useful for a number of reasons. One is security audits of binary artifacts, another (that directly affects us) is making compilation caching as efficient as possible. Preprocessor-based compilation caching breaks when time-dependent macros are used. ### What changes are included in this PR? Remove the `struct static_arbitrary_seed` construct from PCG. Also, enable a gcc/clang warning that detects the use of non-deterministic preprocessor macros. ### Are these changes tested? Yes, by the additional warning (which is turned into an error in "checkin" warnings mode). ### Are there any user-facing changes? No. * Closes: apache#35596 Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
This also breaks reproducible builds and generates a warning from clang |
Minimal example:
Compiling twice gives a cache miss the second time:
The debug log file shows a different hash each time:
The text was updated successfully, but these errors were encountered: