Bug 1419556 - shell_quote() the ComputedFlags in the tup backend; r=chmanchester
authorMike Shal <mshal@mozilla.com>
Tue, 21 Nov 2017 09:29:55 -0500
changeset 701848 37d892d33b6c5fad517a9adaa596940953773f22
parent 701847 96975880806ec6641fe4416aadbf51e546b6723a
child 701849 425acc5494c07e42280142664b9f3b259cdef668
push id90298
push userbmo:bpostelnicu@mozilla.com
push dateWed, 22 Nov 2017 10:54:01 +0000
reviewerschmanchester
bugs1419556
milestone59.0a1
Bug 1419556 - shell_quote() the ComputedFlags in the tup backend; r=chmanchester 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,
                 )