diff options
| author | byteblob <unknown> | 2024-01-08 10:17:10 +0100 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2024-01-09 10:40:58 -0800 |
| commit | ce2db13e94fdeaff72d9e1f23b40072f9fb8818b (patch) | |
| tree | 876b7e08fcc42b66d0f237b66a117c7556e246f6 | |
| parent | 90098473d51e6f059e775f1833b0a2ea91c8f8f9 (diff) | |
| download | meson-ce2db13e94fdeaff72d9e1f23b40072f9fb8818b.tar.gz | |
ninja: Use platform dependent quote instead of shlex.quote() in gcc_rsp_quote()
| -rw-r--r-- | mesonbuild/backend/ninjabackend.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 9acc39c2a..0e1413f85 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -14,7 +14,6 @@ import json import os import pickle import re -import shlex import subprocess import typing as T @@ -67,16 +66,6 @@ def cmd_quote(arg: str) -> str: return arg -def gcc_rsp_quote(s: str) -> str: - # see: the function buildargv() in libiberty - # - # this differs from sh-quoting in that a backslash *always* escapes the - # following character, even inside single quotes. - - s = s.replace('\\', '\\\\') - - return shlex.quote(s) - # How ninja executes command lines differs between Unix and Windows # (see https://ninja-build.org/manual.html#ref_rule_command) if mesonlib.is_windows(): @@ -88,6 +77,15 @@ else: execute_wrapper = [] rmfile_prefix = ['rm', '-f', '{}', '&&'] +def gcc_rsp_quote(s: str) -> str: + # see: the function buildargv() in libiberty + # + # this differs from sh-quoting in that a backslash *always* escapes the + # following character, even inside single quotes. + + s = s.replace('\\', '\\\\') + + return quote_func(s) def get_rsp_threshold() -> int: '''Return a conservative estimate of the commandline size in bytes |
