diff options
author | Daniel Moody <daniel.moody@mongodb.com> | 2022-03-17 10:37:08 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-23 16:45:06 +0000 |
commit | fc2b624564c1ec4f7d27c98e5a0074920e7ee5a1 (patch) | |
tree | 03ad2d29c8075b557677a7367aa78aa72beed584 | |
parent | 1881a6bf29b756110d9e13e82e0999345854bf9c (diff) | |
download | mongo-fc2b624564c1ec4f7d27c98e5a0074920e7ee5a1.tar.gz |
SERVER-56003 use separate run icecc scripts for multiple ninja file builds.
-rw-r--r-- | SConstruct | 11 | ||||
-rw-r--r-- | site_scons/site_tools/icecream.py | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct index 67a057d577a..d6d3820aeb7 100644 --- a/SConstruct +++ b/SConstruct @@ -4545,6 +4545,17 @@ if 'CCACHE' in env and env['CCACHE']: if 'ICECC' in env and env['ICECC']: env['ICECREAM_VERBOSE'] = env.Verbose() env['ICECREAM_TARGET_DIR'] = '$BUILD_ROOT/scons/icecream' + + # Posssibly multiple ninja files are in play, and there are cases where ninja will + # use the wrong icecc run script, so we must create a unique script per ninja variant + # for ninja to track separately. We will use the variant dir which contains the each + # separate ninja builds meta files. This has to be under an additional flag then just + # ninja disabled, because the run icecc script is generated under a context where ninja + # is always disabled via the scons callback mechanism. The __NINJA_NO flag is intended + # to differentiate this particular context. + if env.get('__NINJA_NO') or get_option('ninja') != 'disabled': + env['ICECREAM_RUN_SCRIPT_SUBPATH'] = '$VARIANT_DIR' + icecream = Tool('icecream') if not icecream.exists(env): env.FatalError(f"Failed to load icecream tool with ICECC={env['ICECC']}") diff --git a/site_scons/site_tools/icecream.py b/site_scons/site_tools/icecream.py index 7689d681b1e..f4ffb5fdf3e 100644 --- a/site_scons/site_tools/icecream.py +++ b/site_scons/site_tools/icecream.py @@ -58,7 +58,7 @@ def icecc_create_env(env, target, source, for_signature): # store it in a known location. Add any files requested from the user environment. create_env = "ICECC_VERSION_TMP=$$(${SOURCES[0]} --$ICECC_COMPILER_TYPE ${SOURCES[1]} ${SOURCES[2]}" - # TODO: It would be a little more elegant if things in + # TODO: SERVER-57393 It would be a little more elegant if things in # ICECC_CREATE_ENV_ADDFILES were handled as sources, because we # would get automatic dependency tracking. However, there are some # wrinkles around the mapped case so we have opted to leave it as @@ -328,7 +328,7 @@ def generate(env): # of such a node easily. Creating a Substfile means that SCons # will take care of generating a file that Ninja can use. run_icecc = setupEnv.Textfile( - target="$ICECREAM_TARGET_DIR/run-icecc.sh", + target="$ICECREAM_TARGET_DIR/$ICECREAM_RUN_SCRIPT_SUBPATH/run-icecc.sh", source=[ '#!/bin/sh', 'ICECC_VERSION=@icecc_version_arch@@icecc_version@ exec @icecc@ "$@"', |