summaryrefslogtreecommitdiff
path: root/site_scons
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2020-05-01 15:25:10 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-04 20:42:40 +0000
commit765451d3924cdabb7253f88c7da3e641c7d4b103 (patch)
tree2f01594340f3a759de5bdfe262f37ce2d32fd743 /site_scons
parent2f4044b526ee39cebfe777ecf38653b12bbe092a (diff)
downloadmongo-765451d3924cdabb7253f88c7da3e641c7d4b103.tar.gz
SERVER-47903 Disable ccache and icecc for conftest jobs
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/site_tools/ccache.py23
-rw-r--r--site_scons/site_tools/icecream.py16
2 files changed, 34 insertions, 5 deletions
diff --git a/site_scons/site_tools/ccache.py b/site_scons/site_tools/ccache.py
index 345ddae1194..716ab598339 100644
--- a/site_scons/site_tools/ccache.py
+++ b/site_scons/site_tools/ccache.py
@@ -102,10 +102,25 @@ def generate(env):
# but it doesn't work or is out of date.
env["CCACHE_VERSION"] = _ccache_version_found
+ # Make a generator to expand to CCACHE in the case where we are
+ # not a conftest. We don't want to use ccache for configure tests
+ # because we don't want to use icecream for configure tests, but
+ # when icecream and ccache are combined we can't easily filter out
+ # configure tests for icecream since in that combination we use
+ # CCACHE_PREFIX to express the icecc tool, and at that point it is
+ # too late for us to meaningfully filter out conftests. So we just
+ # disable ccache for conftests entirely. Which feels safer
+ # somehow anyway.
+ def ccache_generator(target, source, env, for_signature):
+ if "conftest" not in str(target[0]):
+ return '$CCACHE'
+ return ''
+ env['CCACHE_GENERATOR'] = ccache_generator
+
# Add ccache to the relevant command lines. Wrap the reference to
# ccache in the $( $) pattern so that turning ccache on or off
# doesn't invalidate your build.
- env["CCCOM"] = "$( $CCACHE $)" + env["CCCOM"]
- env["CXXCOM"] = "$( $CCACHE $)" + env["CXXCOM"]
- env["SHCCCOM"] = "$( $CCACHE $)" + env["SHCCCOM"]
- env["SHCXXCOM"] = "$( $CCACHE $)" + env["SHCXXCOM"]
+ env["CCCOM"] = "$( $CCACHE_GENERATOR $)" + env["CCCOM"]
+ env["CXXCOM"] = "$( $CCACHE_GENERATOR $)" + env["CXXCOM"]
+ env["SHCCCOM"] = "$( $CCACHE_GENERATOR $)" + env["SHCCCOM"]
+ env["SHCXXCOM"] = "$( $CCACHE_GENERATOR $)" + env["SHCXXCOM"]
diff --git a/site_scons/site_tools/icecream.py b/site_scons/site_tools/icecream.py
index a037b7f2d52..c901e879a21 100644
--- a/site_scons/site_tools/icecream.py
+++ b/site_scons/site_tools/icecream.py
@@ -234,7 +234,21 @@ def generate(env):
if ccache_enabled:
env["ENV"]["CCACHE_PREFIX"] = _BoundSubstitution(env, "$ICECC")
else:
- icecc_string = "$( $ICECC $)"
+ # Make a generator to expand to ICECC in the case where we are
+ # not a conftest. We never want to run conftests
+ # remotely. Ideally, we would do this for the CCACHE_PREFIX
+ # case above, but unfortunately if we did we would never
+ # actually see the conftests, because the BoundSubst means
+ # that we will never have a meaningful `target` variable when
+ # we are in ENV. Instead, rely on the ccache.py tool to do
+ # it's own filtering out of conftests.
+ def icecc_generator(target, source, env, for_signature):
+ if "conftest" not in str(target[0]):
+ return '$ICECC'
+ return ''
+ env['ICECC_GENERATOR'] = icecc_generator
+
+ icecc_string = "$( $ICECC_GENERATOR $)"
env["CCCOM"] = " ".join([icecc_string, env["CCCOM"]])
env["CXXCOM"] = " ".join([icecc_string, env["CXXCOM"]])
env["SHCCCOM"] = " ".join([icecc_string, env["SHCCCOM"]])