From a515303fe6ebcfc6083599b458642e6d850b5d39 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 9 Jan 2021 19:52:08 +0100 Subject: [PATCH] Tweak documentation and code related to SOURCE_DATE_EPOCH --- doc/MANUAL.adoc | 5 +++-- src/ccache.cpp | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/MANUAL.adoc b/doc/MANUAL.adoc index dbdbd0d7d7..591650e6e8 100644 --- a/doc/MANUAL.adoc +++ b/doc/MANUAL.adoc @@ -839,8 +839,9 @@ still has to do _some_ preprocessing (like macros). hash but not add the system header files to the list of include files. *time_macros*:: Ignore `__DATE__`, `__TIME__` and `__TIMESTAMP__` being present in the - source code. It will also ignore `SOURCE_DATE_EPOCH` - https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html[environment variable] + source code. The + https://reproducible-builds.org/docs/source-date-epoch/[`SOURCE_DATE_EPOCH` + environment variable] will also be ignored. -- + See the discussion under _<<_troubleshooting,Troubleshooting>>_ for more diff --git a/src/ccache.cpp b/src/ccache.cpp index 6522a8de05..1b430f851a 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -1288,10 +1288,10 @@ hash_common_info(const Context& ctx, hash.hash(Util::base_name(args[0])); // Hash variables that may affect the compilation. - struct + const struct { const char* name; - uint32_t sloppiness; + uint32_t sloppiness; // 0 for "always hash" } hash_env_vars[] = { // From : {"COMPILER_PATH", 0}, @@ -1300,7 +1300,7 @@ hash_common_info(const Context& ctx, {"SOURCE_DATE_EPOCH", SLOPPY_TIME_MACROS}, }; for (const auto& env : hash_env_vars) { - if (env.sloppiness && (ctx.config.sloppiness() & env.sloppiness)) { + if (env.sloppiness != 0 && (ctx.config.sloppiness() & env.sloppiness)) { continue; } const char* value = getenv(env.name);