From f73173d32e103c158c21e5b997ea7b413b2b3633 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Thu, 12 May 2022 20:42:32 +0000 Subject: SERVER-65544 updated build to create a tmpdir for tests to run in. --- site_scons/site_tools/mongo_test_execution.py | 10 ++++++---- site_scons/site_tools/ninja.py | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'site_scons') diff --git a/site_scons/site_tools/mongo_test_execution.py b/site_scons/site_tools/mongo_test_execution.py index 10afeca1c0c..2527ba63a12 100644 --- a/site_scons/site_tools/mongo_test_execution.py +++ b/site_scons/site_tools/mongo_test_execution.py @@ -58,7 +58,9 @@ def generate_test_execution_aliases(env, test): target_name = os.path.basename(installed[0].path) - target_command = env.Command( + test_env = env.Clone() + test_env['ENV']['TMPDIR'] = test_env.Dir('$LOCAL_TMPDIR').abspath + target_command = test_env.Command( target=f"#+{target_name}", source=installed[0], action="$( $ICERUN $) ${SOURCES[0]} $UNITTEST_FLAGS", @@ -85,7 +87,7 @@ def generate_test_execution_aliases(env, test): # We always create the verbose command, but we only create the legacy # command if there isn't a conflict between the target_name and # source_name. Legacy commands must be unique - verbose_source_command = env.Command( + verbose_source_command = test_env.Command( target=f"#+{target_name}-{source_name}", source=installed[0], action="$( $ICERUN $) ${SOURCES[0]} -fileNameFilter $TEST_SOURCE_FILE_NAME $UNITTEST_FLAGS", @@ -102,7 +104,7 @@ def generate_test_execution_aliases(env, test): if len(alias[0].children()) > 1: raise SCons.Errors.BuildError(alias[0].children()[0], f"Multiple unit test programs contain a source file named '{source_name}' which would result in an ambiguous test execution alias. Unit test source filenames are required to be globally unique.") - proof_generator_command = env.Command( + proof_generator_command = test_env.Command( target=[ '${SOURCE}.log', '${SOURCE}.status', @@ -123,7 +125,7 @@ def generate_test_execution_aliases(env, test): env.NoCache(proof_generator_command) env.AlwaysBuild(proof_generator_command) - proof_analyzer_command = env.Command( + proof_analyzer_command = test_env.Command( target='${SOURCES[1].base}.proof', source=proof_generator_command, action=SCons.Action.Action( diff --git a/site_scons/site_tools/ninja.py b/site_scons/site_tools/ninja.py index 27b59a69538..ca35d8659b0 100644 --- a/site_scons/site_tools/ninja.py +++ b/site_scons/site_tools/ninja.py @@ -79,8 +79,8 @@ def _mkdir_action_function(env, node): # to an invalid ninja file. "variables": { # On Windows mkdir "-p" is always on - "cmd": "{mkdir} $out".format( - mkdir="mkdir" if env["PLATFORM"] == "win32" else "mkdir -p", + "cmd": "mkdir {args}".format( + args = ' '.join(get_outputs(node)) + " & exit /b 0" if env["PLATFORM"] == "win32" else "-p " + ' '.join(get_outputs(node)), ), }, } -- cgit v1.2.1