Bug 1403997 - Don't pass tooltool flags to `mach artifact toolchain` when no tooltool manifest is configured. r?mshal
--- 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)