]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Tweak documentation and code related to SOURCE_DATE_EPOCH
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 9 Jan 2021 18:52:08 +0000 (19:52 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 9 Jan 2021 18:52:08 +0000 (19:52 +0100)
doc/MANUAL.adoc
src/ccache.cpp

index dbdbd0d7d7596578528b183c883d21007b973a7c..591650e6e8da806cac9b1eb61a37e9985f4588a1 100644 (file)
@@ -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
index 6522a8de053c10b3b7f35718c84e331e250e2d11..1b430f851aacf12e7776e089268b0ee4c002a8d4 100644 (file)
@@ -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 <https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html>:
     {"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);