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-05 21:37:35 +0000
commit3b49072f5c12fea5b64003f7116d6d8c81e36162 (patch)
tree3179b2861a2c768fcac32869ee748cbd974de3ef /site_scons
parent3f2b019a750f7aa1cfc87d57e8b5b0691494d329 (diff)
downloadmongo-3b49072f5c12fea5b64003f7116d6d8c81e36162.tar.gz
SERVER-47903 Disable ccache and icecc for conftest jobs
(cherry picked from commit 765451d3924cdabb7253f88c7da3e641c7d4b103)
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 00fcf76f4b5..541998b2acb 100644
--- a/site_scons/site_tools/ccache.py
+++ b/site_scons/site_tools/ccache.py
@@ -94,10 +94,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 e5bf112767d..065729fc788 100644
--- a/site_scons/site_tools/icecream.py
+++ b/site_scons/site_tools/icecream.py
@@ -226,7 +226,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"]])