Bug 837846 - Fix MOZ_MAKE_FLAGS handling for client.mk. r=mshal

After bug 762358 mk_add_options MOZ_MAKE_FLAGS was simply ignored in client.mk
processing. At the same time, mach environment was expecting a list of options
while the mozconfig reader returned a single string, so straighten this up at
the same time.
This commit is contained in:
Mike Hommey 2014-09-24 07:56:58 +09:00
parent aae5ca6afd
commit 00f2cd8287
3 changed files with 5 additions and 3 deletions

View File

@ -1117,6 +1117,8 @@ class MachDebug(MachCommandBase):
if self.mozconfig['make_extra']:
for arg in self.mozconfig['make_extra']:
print(arg, file=out)
if self.mozconfig['make_flags']:
print('MOZ_MAKE_FLAGS=%s' % ' '.join(self.mozconfig['make_flags']))
objdir = mozpath.normsep(self.topobjdir)
print('MOZ_OBJDIR=%s' % objdir, file=out)
if 'MOZ_CURRENT_PROJECT' in os.environ:

View File

@ -301,7 +301,7 @@ class MozconfigLoader(ProcessExecutionMixin):
name, value = match.group('var'), match.group('value')
if name == 'MOZ_MAKE_FLAGS':
result['make_flags'] = value
result['make_flags'] = value.split()
continue
if name == 'MOZ_OBJDIR':

View File

@ -309,14 +309,14 @@ class TestMozconfigLoader(unittest.TestCase):
"""Ensures mk_add_options calls are captured."""
with NamedTemporaryFile(mode='w') as mozconfig:
mozconfig.write('mk_add_options MOZ_OBJDIR=/foo/bar\n')
mozconfig.write('mk_add_options MOZ_MAKE_FLAGS=-j8\n')
mozconfig.write('mk_add_options MOZ_MAKE_FLAGS="-j8 -s"\n')
mozconfig.write('mk_add_options FOO="BAR BAZ"\n')
mozconfig.write('mk_add_options BIZ=1\n')
mozconfig.flush()
result = self.get_loader().read_mozconfig(mozconfig.name)
self.assertEqual(result['topobjdir'], '/foo/bar')
self.assertEqual(result['make_flags'], '-j8')
self.assertEqual(result['make_flags'], ['-j8', '-s'])
self.assertEqual(result['make_extra'], ['FOO=BAR BAZ', 'BIZ=1'])
def test_read_empty_mozconfig_objdir_environ(self):