0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-47903 Disable ccache and icecc for conftest jobs

This commit is contained in:
Andrew Morrow 2020-05-01 15:25:10 -04:00 committed by Evergreen Agent
parent 2f4044b526
commit 765451d392
2 changed files with 34 additions and 5 deletions

View File

@ -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"]

View File

@ -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"]])