diff options
author | Andrew Morrow <acm@mongodb.com> | 2020-02-06 17:24:44 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-07 16:33:45 +0000 |
commit | 01074b45187e60e365218a28d832f9000e37b047 (patch) | |
tree | 51c37707f090f79c856672ca5a883930dcabec1c | |
parent | 3b5e1c0e2148496a0fd39e7fea8fafb67e3ba06b (diff) | |
download | mongo-01074b45187e60e365218a28d832f9000e37b047.tar.gz |
SERVER-46021 Improve Ninja generator escaping for origin processing
-rw-r--r-- | site_scons/site_tools/ninja.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/site_scons/site_tools/ninja.py b/site_scons/site_tools/ninja.py index a3326907c87..7e2d61ecb6a 100644 --- a/site_scons/site_tools/ninja.py +++ b/site_scons/site_tools/ninja.py @@ -843,6 +843,11 @@ def gen_get_response_file_command(env, rule, tool, tool_is_dynamic=False): raise Exception("Could not find tool {} in {} generated from {}".format(tool, cmd_list, get_comstr(env, action, targets, sources))) cmd, rsp_content = cmd_list[:tool_idx], cmd_list[tool_idx:] + + # Some commands may have a need to pass a literal $ to a tool + # like ld (think $ORIGIN). We need to protect that $ from + # Ninja by using $$. + rsp_content = " ".join(rsp_content).replace('$', '$$') variables = {"rspc": rsp_content} variables[rule] = cmd if use_command_env: |