Skip to content

Commit

Permalink
Tweak documentation and code related to SOURCE_DATE_EPOCH
Browse files Browse the repository at this point in the history
  • Loading branch information
jrosdahl committed Jan 9, 2021
1 parent be1ed77 commit a515303
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions doc/MANUAL.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/ccache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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);
Expand Down

0 comments on commit a515303

Please sign in to comment.