Bug 1403997 - Don't pass tooltool flags to `mach artifact toolchain` when no tooltool manifest is configured. r?mshal draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 04 Oct 2017 15:11:25 +0900
changeset 674705 9b6e2384bf5fd9e7e800320c34d5d8d12ec60b1a
parent 674704 9ffc6dabe41b05022e44ba85998508ea8c95526d
child 734402 3b38957a94f15aacf6f1e3424353085fcef316d8
push id82914
push userbmo:mh+mozilla@glandium.org
push dateWed, 04 Oct 2017 06:49:16 +0000
reviewersmshal
bugs1403997
milestone58.0a1
Bug 1403997 - Don't pass tooltool flags to `mach artifact toolchain` when no tooltool manifest is configured. r?mshal
testing/mozharness/mozharness/mozilla/building/buildbase.py
testing/mozharness/scripts/desktop_l10n.py
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -1117,35 +1117,36 @@ or run without that action (ie: --no-{ac
         c = self.config
         dirs = self.query_abs_dirs()
         toolchains = os.environ.get('MOZ_TOOLCHAINS')
         manifest_src = os.environ.get('TOOLTOOL_MANIFEST')
         if not manifest_src:
             manifest_src = c.get('tooltool_manifest_src')
         if not manifest_src and not toolchains:
             return self.warning(ERROR_MSGS['tooltool_manifest_undetermined'])
-        tooltool_manifest_path = os.path.join(dirs['abs_src_dir'],
-                                              manifest_src)
         cmd = [
             sys.executable, '-u',
             os.path.join(dirs['abs_src_dir'], 'mach'),
             'artifact',
             'toolchain',
             '-v',
             '--retry', '4',
-            '--tooltool-manifest',
-            tooltool_manifest_path,
             '--artifact-manifest',
             os.path.join(dirs['abs_src_dir'], 'toolchains.json'),
-            '--tooltool-url',
-            c['tooltool_url'],
         ]
-        auth_file = self._get_tooltool_auth_file()
-        if auth_file:
-            cmd.extend(['--authentication-file', auth_file])
+        if manifest_src:
+            cmd.extend([
+                '--tooltool-manifest',
+                os.path.join(dirs['abs_src_dir'], manifest_src),
+                '--tooltool-url',
+                c['tooltool_url'],
+            ])
+            auth_file = self._get_tooltool_auth_file()
+            if auth_file:
+                cmd.extend(['--authentication-file', auth_file])
         cache = c['env'].get('TOOLTOOL_CACHE')
         if cache:
             cmd.extend(['--cache-dir', cache])
         if toolchains:
             cmd.extend(toolchains.split())
         self.info(str(cmd))
         self.run_command_m(cmd, cwd=dirs['abs_src_dir'], halt_on_failure=True,
                            env=env)
--- a/testing/mozharness/scripts/desktop_l10n.py
+++ b/testing/mozharness/scripts/desktop_l10n.py
@@ -1048,41 +1048,42 @@ class DesktopSingleLocale(LocalesMixin, 
         config = self.config
         dirs = self.query_abs_dirs()
         toolchains = os.environ.get('MOZ_TOOLCHAINS')
         manifest_src = os.environ.get('TOOLTOOL_MANIFEST')
         if not manifest_src:
             manifest_src = config.get('tooltool_manifest_src')
         if not manifest_src and not toolchains:
             return
-        tooltool_manifest_path = os.path.join(dirs['abs_mozilla_dir'],
-                                              manifest_src)
         python = sys.executable
         # A mock environment is a special case, the system python isn't
         # available there
         if 'mock_target' in self.config:
             python = 'python2.7'
 
         cmd = [
             python, '-u',
             os.path.join(dirs['abs_mozilla_dir'], 'mach'),
             'artifact',
             'toolchain',
             '-v',
             '--retry', '4',
-            '--tooltool-manifest',
-            tooltool_manifest_path,
             '--artifact-manifest',
             os.path.join(dirs['abs_mozilla_dir'], 'toolchains.json'),
-            '--tooltool-url',
-            config['tooltool_url'],
         ]
-        auth_file = self._get_tooltool_auth_file()
-        if auth_file and os.path.exists(auth_file):
-            cmd.extend(['--authentication-file', auth_file])
+        if manifest_src:
+            cmd.extend([
+                '--tooltool-manifest',
+                os.path.join(dirs['abs_mozilla_dir'], manifest_src),
+                '--tooltool-url',
+                config['tooltool_url'],
+            ])
+            auth_file = self._get_tooltool_auth_file()
+            if auth_file and os.path.exists(auth_file):
+                cmd.extend(['--authentication-file', auth_file])
         cache = config['bootstrap_env'].get('TOOLTOOL_CACHE')
         if cache:
             cmd.extend(['--cache-dir', cache])
         if toolchains:
             cmd.extend(toolchains.split())
         self.info(str(cmd))
         self.run_command(cmd, cwd=dirs['abs_mozilla_dir'], halt_on_failure=True,
                          env=env)