Bug 1529195 - Allow to opt-in to symbols/host-bin artifacts from the CLI. r=chmanchester

and to opt-out of test artifacts.

Depends on D20445

Differential Revision: https://phabricator.services.mozilla.com/D20446

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-02-21 22:53:43 +00:00
Родитель 79bf8a087d
Коммит d3af9d50b9
3 изменённых файлов: 30 добавлений и 15 удалений

Просмотреть файл

@ -163,8 +163,12 @@ binaries::
@$(MAKE) install-manifests install_manifests=dist/include
endif
# Host binaries are not produced for macOS consumers: that is, there's
# no macOS-hosted job to produce them at this time. Therefore we
# enable --host-bins only for automation builds, which only require Linux and
# Windows host binaries.
recurse_artifact:
$(topsrcdir)/mach --log-no-times artifact install
$(topsrcdir)/mach --log-no-times artifact install$(if $(MOZ_ARTIFACT_BUILD_SYMBOLS), --symbols)$(if $(MOZ_AUTOMATION), --host-bins)
ifdef MOZ_WIDGET_TOOLKIT
ifdef ENABLE_TESTS

Просмотреть файл

@ -148,11 +148,14 @@ class ArtifactJob(object):
_test_tar_archive_suffix = '.common.tests.tar.gz'
def __init__(self, log=None,
download_tests=True,
download_symbols=False,
download_host_bins=False,
substs=None):
self._package_re = re.compile(self.package_re)
self._tests_re = re.compile(r'public/build/target\.common\.tests\.(zip|tar\.gz)')
self._tests_re = None
if download_tests:
self._tests_re = re.compile(r'public/build/target\.common\.tests\.(zip|tar\.gz)')
self._host_bins_re = None
if download_host_bins:
self._host_bins_re = re.compile(r'public/build/host/bin/(mar|mbsdiff)(.exe)?')
@ -899,17 +902,12 @@ class Artifacts(object):
def __init__(self, tree, substs, defines, job=None, log=None,
cache_dir='.', hg=None, git=None, skip_cache=False,
topsrcdir=None):
topsrcdir=None, download_tests=True, download_symbols=False,
download_host_bins=False):
if (hg and git) or (not hg and not git):
raise ValueError("Must provide path to exactly one of hg and git")
self._substs = substs
self._download_symbols = self._substs.get('MOZ_ARTIFACT_BUILD_SYMBOLS', False)
# Host binaries are not produced for macOS consumers: that is, there's
# no macOS-hosted job to produce them at this time. Therefore we
# enable this only for automation builds, which only require Linux and
# Windows host binaries.
self._download_host_bins = self._substs.get('MOZ_AUTOMATION', False)
self._defines = defines
self._tree = tree
self._job = job or self._guess_artifact_job()
@ -923,8 +921,9 @@ class Artifacts(object):
try:
cls = JOB_DETAILS[self._job]
self._artifact_job = cls(log=self._log,
download_symbols=self._download_symbols,
download_host_bins=self._download_host_bins,
download_tests=download_tests,
download_symbols=download_symbols,
download_host_bins=download_host_bins,
substs=self._substs)
except KeyError:
self.log(logging.INFO, 'artifact',

Просмотреть файл

@ -1258,7 +1258,9 @@ class PackageFrontend(MachCommandBase):
'''
pass
def _make_artifacts(self, tree=None, job=None, skip_cache=False):
def _make_artifacts(self, tree=None, job=None, skip_cache=False,
download_tests=True, download_symbols=False,
download_host_bins=False):
state_dir = self._mach_context.state_dir
cache_dir = os.path.join(state_dir, 'package-frontend')
@ -1279,7 +1281,10 @@ class PackageFrontend(MachCommandBase):
artifacts = Artifacts(tree, self.substs, self.defines, job,
log=self.log, cache_dir=cache_dir,
skip_cache=skip_cache, hg=hg, git=git,
topsrcdir=self.topsrcdir)
topsrcdir=self.topsrcdir,
download_tests=download_tests,
download_symbols=download_symbols,
download_host_bins=download_host_bins)
return artifacts
@ArtifactSubCommand('artifact', 'install',
@ -1292,9 +1297,16 @@ class PackageFrontend(MachCommandBase):
@CommandArgument('--skip-cache', action='store_true',
help='Skip all local caches to force re-fetching remote artifacts.',
default=False)
def artifact_install(self, source=None, skip_cache=False, tree=None, job=None, verbose=False):
@CommandArgument('--no-tests', action='store_true', help="Don't install tests.")
@CommandArgument('--symbols', action='store_true', help='Download symbols.')
@CommandArgument('--host-bins', action='store_true', help='Download host binaries.')
def artifact_install(self, source=None, skip_cache=False, tree=None, job=None, verbose=False,
no_tests=False, symbols=False, host_bins=False):
self._set_log_level(verbose)
artifacts = self._make_artifacts(tree=tree, job=job, skip_cache=skip_cache)
artifacts = self._make_artifacts(tree=tree, job=job, skip_cache=skip_cache,
download_tests=not no_tests,
download_symbols=symbols,
download_host_bins=host_bins)
return artifacts.install_from(source, self.distdir)