summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2020-08-14 14:11:07 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-18 12:01:53 +0000
commit8d88b7291880b3d44e7d6fd8d5d7fcdb19099c23 (patch)
tree78376e3128fbfa843a1ff4059466d881451ffd6f
parentb55e4c716bc0e23384751f942488fde28f65725b (diff)
downloadmongo-r4.4.1-rc0.tar.gz
SERVER-49466 Introduce a flag to opt in to newer mongodb SCons tools as a groupr4.4.1-rc0
(cherry picked from commit c40e96ea0b650402af0b52bd6a70f5ea67464054)
-rw-r--r--SConstruct24
-rw-r--r--site_scons/site_tools/next/ninja.py (renamed from site_scons/site_tools/ninja_next.py)0
2 files changed, 18 insertions, 6 deletions
diff --git a/SConstruct b/SConstruct
index da262bd2575..47b553a1649 100644
--- a/SConstruct
+++ b/SConstruct
@@ -117,6 +117,13 @@ add_option('prefix',
help='installation prefix (conficts with DESTDIR, PREFIX, and --install-mode=hygienic)',
)
+add_option('build-tools',
+ choices=['stable', 'next'],
+ default='stable',
+ type='choice',
+ help='Enable experimental build tools',
+)
+
add_option('legacy-tarball',
choices=['true', 'false'],
default='false',
@@ -1112,6 +1119,13 @@ if get_option('install-mode') != 'hygienic':
envDict["LIBFUZZER_TEST_ALIAS"] = "libfuzzer_tests"
envDict["BENCHMARK_ALIAS"] = "benchmarks"
+# By default, we will get the normal SCons tool search. But if the
+# user has opted into the next gen tools, add our experimental tool
+# directory into the default toolpath, ahead of whatever is already in
+# there so it overrides it.
+if get_option('build-tools') == 'next' or get_option('ninja') == 'next':
+ SCons.Tool.DefaultToolpath.insert(0, os.path.abspath('site_scons/site_tools/next'))
+
env = Environment(variables=env_vars, **envDict)
# Only print the spinner if stdout is a tty
@@ -3902,11 +3916,8 @@ if get_option('ninja') != 'disabled':
if env['ICECREAM_VERSION'] < parse_version("1.2"):
env.FatalError("Use of ccache is mandatory with --ninja and icecream older than 1.2. You are running {}.".format(env['ICECREAM_VERSION']))
- if get_option('ninja') == 'stable':
- ninja_builder = Tool("ninja")
- ninja_builder.generate(env)
- else:
- ninja_builder = Tool("ninja_next")
+ ninja_builder = Tool("ninja")
+ if get_option('build-tools') == 'next' or get_option('ninja') == 'next':
env["NINJA_BUILDDIR"] = env.Dir("$BUILD_DIR/ninja")
ninja_builder.generate(env)
@@ -3915,7 +3926,8 @@ if get_option('ninja') != 'disabled':
})
env['NINJA_COMPDB_EXPAND'] = ninjaConf.CheckNinjaCompdbExpand()
ninjaConf.Finish()
-
+ else:
+ ninja_builder.generate(env)
# idlc.py has the ability to print it's implicit dependencies
# while generating, Ninja can consume these prints using the
diff --git a/site_scons/site_tools/ninja_next.py b/site_scons/site_tools/next/ninja.py
index aff20498b60..aff20498b60 100644
--- a/site_scons/site_tools/ninja_next.py
+++ b/site_scons/site_tools/next/ninja.py