summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2022-03-25 14:01:49 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-28 22:46:38 +0000
commitfcf8de14cb92fb4ff5874308104ca942ea11b655 (patch)
tree1d7c7f05df62edc82e0fdddcad81974fa31b8bc0
parent18eb70e70613854d240b3c0f6e5fa52de01fe141 (diff)
downloadmongo-fcf8de14cb92fb4ff5874308104ca942ea11b655.tar.gz
SERVER-62313 Disable ccache cpp2 when sanitizer denylists are in play
-rw-r--r--SConstruct1
-rw-r--r--site_scons/site_tools/ccache.py12
2 files changed, 9 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct
index 2d7b12f1f9f..d8c8f52a1e2 100644
--- a/SConstruct
+++ b/SConstruct
@@ -3568,6 +3568,7 @@ def doConfigure(myenv):
# https://github.com/ccache/ccache/pull/258
# https://github.com/ccache/ccache/issues/318
env.Append(CCACHE_EXTRAFILES=supportedDenyfiles)
+ env['CCACHE_EXTRAFILES_USE_SOURCE_PATHS'] = True
def SanitizerDenylistGenerator(source, target, env, for_signature):
if for_signature:
diff --git a/site_scons/site_tools/ccache.py b/site_scons/site_tools/ccache.py
index de7d03e5472..2a4b89015d5 100644
--- a/site_scons/site_tools/ccache.py
+++ b/site_scons/site_tools/ccache.py
@@ -112,11 +112,15 @@ def generate(env):
# hash can be calculated on them. This both reduces the amount of work ccache needs to
# do and increases the likelihood of a cache hit.
if env.ToolchainIs("clang"):
- env["ENV"].pop("CCACHE_CPP2", None)
- env["ENV"]["CCACHE_NOCPP2"] = "1"
- env.AppendUnique(CCFLAGS=["-frewrite-includes"])
+ if not env.get('CCACHE_EXTRAFILES_USE_SOURCE_PATHS', False):
+ env["ENV"].pop("CCACHE_CPP2", None)
+ env["ENV"]["CCACHE_NOCPP2"] = "1"
+ env.AppendUnique(CCFLAGS=["-frewrite-includes"])
+ else:
+ env["ENV"].pop("CCACHE_NOCPP2", None)
+ env["ENV"]["CCACHE_CPP2"] = "1"
elif env.ToolchainIs("gcc"):
- if icecream_enabled:
+ if icecream_enabled and not env.get('CCACHE_EXTRAFILES_USE_SOURCE_PATHS', False):
# Newer versions of Icecream will drop -fdirectives-only from
# preprocessor and compiler flags if it does not find a remote
# build host to build on. ccache, on the other hand, will not