-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[C++] PCG breaks compilation caching #35596
Comments
pitrou
added a commit
to pitrou/arrow
that referenced
this issue
May 15, 2023
Also warn/error out if non-deterministic compilation macros such as `__TIME__` are used (with gcc and clang at least).
Interesting, I also have #34715 open which could be a big improvement for our caching situation. |
pitrou
added a commit
that referenced
this issue
May 16, 2023
### 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]>
rtpsw
pushed a commit
to rtpsw/arrow
that referenced
this issue
May 16, 2023
…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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug, including details regarding any error messages, version, and platform.
Noticing that I sometimes got unexpected slow rebuilds, I tried to dive a bit into ccache debug output and found out that by default the PCG headers use the
__DATE__
and__TIME__
macros, which makes builds non-deterministic:imneme/pcg-cpp#59
We should perhaps simply remove PCG's
struct static_arbitrary_seed
, which would make compilation caching more efficient. @benibus @bkietz @assignUserComponent(s)
C++
The text was updated successfully, but these errors were encountered: