summaryrefslogtreecommitdiff
path: root/site_scons
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2021-08-03 12:09:31 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-08-04 20:01:03 +0000
commitdee0f733cdb3cab7714326574efc8a1ae4ec750f (patch)
tree3d4b4a7d73a19e7dc17712a93d5ab9e204e9a401 /site_scons
parent4963780f64c485e72d46d2f4361aedd3c68a2966 (diff)
downloadmongo-dee0f733cdb3cab7714326574efc8a1ae4ec750f.tar.gz
SERVER-58904 update ninja tool to support $ in scons command line args.
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/site_tools/next/ninja.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/site_scons/site_tools/next/ninja.py b/site_scons/site_tools/next/ninja.py
index 67d27490c77..8961764d08b 100644
--- a/site_scons/site_tools/next/ninja.py
+++ b/site_scons/site_tools/next/ninja.py
@@ -423,9 +423,9 @@ class SConsToNinjaTranslator:
class NinjaState:
"""Maintains state of Ninja build system as it's translated from SCons."""
- def __init__(self, env, writer_class):
+ def __init__(self, env, ninja_syntax):
self.env = env
- self.writer_class = writer_class
+ self.writer_class = ninja_syntax.Writer
self.__generated = False
self.translator = SConsToNinjaTranslator(env)
self.generated_suffixes = env.get("NINJA_GENERATED_SOURCE_SUFFIXES", [])
@@ -442,18 +442,18 @@ class NinjaState:
# shell quoting on whatever platform it's run on. Here we use it
# to make the SCONS_INVOCATION variable properly quoted for things
# like CCFLAGS
- escape = env.get("ESCAPE", lambda x: x)
+ scons_escape = env.get("ESCAPE", lambda x: x)
self.variables = {
"COPY": "cmd.exe /c 1>NUL copy" if sys.platform == "win32" else "cp",
"SCONS_INVOCATION": "{} {} __NINJA_NO=1 $out".format(
sys.executable,
" ".join(
- [escape(arg) for arg in sys.argv if arg not in COMMAND_LINE_TARGETS]
+ [ninja_syntax.escape(scons_escape(arg)) for arg in sys.argv if arg not in COMMAND_LINE_TARGETS]
),
),
"SCONS_INVOCATION_W_TARGETS": "{} {}".format(
- sys.executable, " ".join([escape(arg) for arg in sys.argv])
+ sys.executable, " ".join([ninja_syntax.escape(scons_escape(arg)) for arg in sys.argv])
),
# This must be set to a global default per:
# https://ninja-build.org/manual.html
@@ -1612,7 +1612,7 @@ def generate(env):
ninja_syntax = importlib.import_module(ninja_syntax_mod_name.replace(".py", ""))
global NINJA_STATE
- NINJA_STATE = NinjaState(env, ninja_syntax.Writer)
+ NINJA_STATE = NinjaState(env, ninja_syntax)
# Here we will force every builder to use an emitter which makes the ninja
# file depend on it's target. This forces the ninja file to the bottom of