Bug 1412356 - Don't invoke client.mk from mobile l10n automation; r?build draft
authorGregory Szorc <gps@mozilla.com>
Fri, 27 Oct 2017 10:07:52 -0700
changeset 690317 a2337cf61c064b21bfeac9f14fa73fa27badb699
parent 690034 cd7217cf05a2332a8fd7b498767a07b2c31ea657
child 690318 5f1aaed00de282c8579f68c853d3430530c03b75
push id87281
push usergszorc@mozilla.com
push dateWed, 01 Nov 2017 21:44:15 +0000
reviewersbuild
bugs1412356
milestone58.0a1
Bug 1412356 - Don't invoke client.mk from mobile l10n automation; r?build The old code was simply running configure and manually invoking some make targets via client.mk. These can both be done via `mach`. As part of the change, the build targets have been consolidated. There is still an abstraction leak here. But at least we aren't using client.mk. MozReview-Commit-ID: 7oMXPWPZS6V
testing/mozharness/scripts/mobile_l10n.py
--- a/testing/mozharness/scripts/mobile_l10n.py
+++ b/testing/mozharness/scripts/mobile_l10n.py
@@ -421,36 +421,38 @@ class MobileSingleLocale(MockMixin, Loca
     def clone_locales(self):
         self.pull_locale_source()
 
     # list_locales() is defined in LocalesMixin.
 
     def _setup_configure(self, buildid=None):
         dirs = self.query_abs_dirs()
         env = self.query_repack_env()
-        make = self.query_exe("make")
-        if self.run_command_m([make, "-f", "client.mk", "configure"],
+
+        mach = os.path.join(dirs['abs_mozilla_dir'], 'mach')
+
+        if self.run_command_m([sys.executable, mach, 'configure'],
                               cwd=dirs['abs_mozilla_dir'],
                               env=env,
                               error_list=MakefileErrorList):
             self.fatal("Configure failed!")
 
-        # Run 'make export' in objdir/config to get nsinstall
-        self.run_command_m([make, 'export'],
-                           cwd=os.path.join(dirs['abs_objdir'], 'config'),
-                           env=env,
-                           error_list=MakefileErrorList,
-                           halt_on_failure=True)
+        # Invoke the build system to get nsinstall and buildid.h.
+        targets = [
+            'config/export',
+            'buildid.h',
+        ]
 
-        # Run 'make buildid.h' in objdir/ to get the buildid.h file
-        cmd = [make, 'buildid.h']
+        # Force the buildid if one is defined.
         if buildid:
-            cmd.append('MOZ_BUILD_DATE=%s' % str(buildid))
-        self.run_command_m(cmd,
-                           cwd=dirs['abs_objdir'],
+            env = dict(env)
+            env['MOZ_BUILD_DATE'] = str(buildid)
+
+        self.run_command_m([sys.executable, mach, 'build'] + targets,
+                           cwd=dirs['abs_mozilla_dir'],
                            env=env,
                            error_list=MakefileErrorList,
                            halt_on_failure=True)
 
     def setup(self):
         c = self.config
         dirs = self.query_abs_dirs()
         mozconfig_path = os.path.join(dirs['abs_mozilla_dir'], '.mozconfig')