summaryrefslogtreecommitdiff
path: root/site_scons
diff options
context:
space:
mode:
authorAndrew Morrow <andrew.morrow@10gen.com>2019-10-11 20:39:56 +0000
committerevergreen <evergreen@mongodb.com>2019-10-11 20:39:56 +0000
commit0682563bfb28c7275fbaeaac47ee31a7f77e19ca (patch)
treec5a0f7d3e8ab9b2f8df3382a9eae7c1f107f24f9 /site_scons
parent70383ed065e8798aafc4394af7c6d2ac92927f41 (diff)
downloadmongo-0682563bfb28c7275fbaeaac47ee31a7f77e19ca.tar.gz
SERVER-43368 Revert SCons icecream integration to working state
This reverts the following commits: - 166a5d78c1103a58dbd41d1e45aa6037ba4a3e42 - f659b76958858056cdb7558032cb70bdd53c57b3
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/site_tools/icecream.py32
1 files changed, 23 insertions, 9 deletions
diff --git a/site_scons/site_tools/icecream.py b/site_scons/site_tools/icecream.py
index 0abb469e63c..c570c869fd7 100644
--- a/site_scons/site_tools/icecream.py
+++ b/site_scons/site_tools/icecream.py
@@ -56,7 +56,8 @@ def generate(env):
# then fetch it to somewhere under $BUILD_ROOT/scons/icecc
# with its "correct" name (i.e. the md5 hash), and symlink it
# to some other deterministic name to use as icecc_version.
- env["ENV"]["ICECC_VERSION"] = env["ICECC_VERSION"]
+
+ pass
else:
# Make a predictable name for the toolchain
icecc_version_target_filename = env.subst('$CC$CXX').replace('/', '_')
@@ -65,9 +66,8 @@ def generate(env):
# Make an isolated environment so that our setting of ICECC_VERSION in the environment
# doesn't appear when executing icecc_create_env
toolchain_env = env.Clone()
- toolchain_env.Decider("timestamp-newer")
if toolchain_env.ToolchainIs('clang'):
- toolchain = toolchain_env.Command(
+ toolchain = env.Command(
target=icecc_version,
source=[
'$ICECC_CREATE_ENV',
@@ -123,8 +123,7 @@ def generate(env):
# Add ICECC_VERSION to the environment, pointed at the generated
# file so that we can expand it in the realpath expressions for
# CXXCOM and friends below.
- env['ICECC_SYMLINK_VERSION'] = icecc_version
- env['ENV']['ICECC_VERSION'] = os.path.realpath(env.File("$ICECC_SYMLINK_VERSION").abspath)
+ env['ICECC_VERSION'] = icecc_version
if env.ToolchainIs('clang'):
env['ENV']['ICECC_CLANG_REMOTE_CPP'] = 1
@@ -138,11 +137,26 @@ def generate(env):
if 'ICECC_SCHEDULER' in env:
env['ENV']['USE_SCHEDULER'] = env['ICECC_SCHEDULER']
+ # Not all platforms have the readlink utility, so create our own
+ # generator for that.
+ def icecc_version_gen(target, source, env, for_signature):
+ f = env.File('$ICECC_VERSION')
+ if not f.islink():
+ return f
+ return env.File(os.path.realpath(f.abspath))
+ env['ICECC_VERSION_GEN'] = icecc_version_gen
+
+ def icecc_version_arch_gen(target, source, env, for_signature):
+ if 'ICECC_VERSION_ARCH' in env:
+ return "${ICECC_VERSION_ARCH}:"
+ return str()
+ env['ICECC_VERSION_ARCH_GEN'] = icecc_version_arch_gen
+
# Make compile jobs flow through icecc
- env['CCCOM'] = '$( $ICECC $) ' + env['CCCOM']
- env['CXXCOM'] = '$( $ICECC $) ' + env['CXXCOM']
- env['SHCCCOM'] = '$( $ICECC $) ' + env['SHCCCOM']
- env['SHCXXCOM'] = '$( $ICECC $) ' + env['SHCXXCOM']
+ env['CCCOM'] = '$( ICECC_VERSION=${ICECC_VERSION_ARCH_GEN}${ICECC_VERSION_GEN} $ICECC $) ' + env['CCCOM']
+ env['CXXCOM'] = '$( ICECC_VERSION=${ICECC_VERSION_ARCH_GEN}${ICECC_VERSION_GEN} $ICECC $) ' + env['CXXCOM']
+ env['SHCCCOM'] = '$( ICECC_VERSION=${ICECC_VERSION_ARCH_GEN}${ICECC_VERSION_GEN} $ICECC $) ' + env['SHCCCOM']
+ env['SHCXXCOM'] = '$( ICECC_VERSION=${ICECC_VERSION_ARCH_GEN}${ICECC_VERSION_GEN} $ICECC $) ' + env['SHCXXCOM']
# Make link like jobs flow through icerun so we don't kill the
# local machine.