Bug 1419556 - shell_quote() the ComputedFlags in the tup backend; r?Build
Flags like -DMOZ_APP_NAME="firefox" need to be sent through the shell as
'-DMOZ_APP_NAME="firefox"', otherwise the double-quotes get eaten and
the string is invalid.
MozReview-Commit-ID: 7QN3VTMAY77
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -124,18 +124,18 @@ class BackendTupfile(object):
('.c', 'CC', 'CFLAGS'),
]
for extension, compiler, flags in compilers:
srcs = sorted(self.sources[extension])
for src in srcs:
# AS can be set to $(CC), so we need to call expand_variables on
# the compiler to get the real value.
cmd = [expand_variables(self.environment.substs[compiler], self.environment.substs)]
- cmd.extend(self.local_flags[flags])
- cmd.extend(self.per_source_flags[src])
+ cmd.extend(shell_quote(f) for f in self.local_flags[flags])
+ cmd.extend(shell_quote(f) for f in self.per_source_flags[src])
cmd.extend(['-c', '%f', '-o', '%o'])
self.rule(
cmd=cmd,
inputs=[src],
extra_inputs=extra_inputs,
outputs=['%B.o'],
display='%s %%f' % compiler,
)