Bug 1419556 - shell_quote() the ComputedFlags in the tup backend; r?Build draft
authorMike Shal <mshal@mozilla.com>
Tue, 21 Nov 2017 09:29:55 -0500
changeset 701581 e41fde6efc00987e1bd0fe6d20fcf828047e742b
parent 700576 5c48b5edfc4ca945a2eaa5896454f3f4efa9052a
child 701582 d334b0cb1a4fe086440a770bd7fac19f11afe620
push id90205
push userbmo:mshal@mozilla.com
push dateTue, 21 Nov 2017 21:29:55 +0000
reviewersBuild
bugs1419556
milestone59.0a1
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
python/mozbuild/mozbuild/backend/tup.py
--- 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,
                 )