Skip to content
Permalink
Browse files

Bug 1530908 - Move list of supported artifact builds to an importable…

… module. r=chmanchester

Depends on D22054

Differential Revision: https://phabricator.services.mozilla.com/D22055
  • Loading branch information...
glandium committed Mar 6, 2019
1 parent fb52291 commit e2a098a0fe78130d9754a39cddba15eb054b09cf
@@ -0,0 +1,31 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# The values correspond to entries at
# https://tools.taskcluster.net/index/artifacts/#gecko.v2.mozilla-central.latest/gecko.v2.mozilla-central.latest
JOB_CHOICES = {
'android-api-16-opt',
'android-api-16-debug',
'android-x86-opt',
'android-x86_64-opt',
'android-x86_64-debug',
'android-aarch64-opt',
'android-aarch64-debug',
'linux-opt',
'linux-pgo',
'linux-debug',
'linux64-opt',
'linux64-pgo',
'linux64-debug',
'macosx64-opt',
'macosx64-debug',
'win32-opt',
'win32-pgo',
'win32-debug',
'win64-opt',
'win64-pgo',
'win64-debug',
'win64-aarch64-opt',
'win64-aarch64-debug',
}
@@ -68,6 +68,7 @@
list_artifacts,
)

from mozbuild.artifact_builds import JOB_CHOICES
from mozbuild.util import (
ensureParentDir,
FileAvoidWrite,
@@ -533,34 +534,21 @@ def process_package_artifact(self, filename, processed_filename):
'matched an archive path.'.format(
patterns=self.artifact_patterns))

# Keep the keys of this map in sync with the |mach artifact| --job
# options. The keys of this map correspond to entries at
# https://tools.taskcluster.net/index/artifacts/#gecko.v2.mozilla-central.latest/gecko.v2.mozilla-central.latest
# The values correpsond to a pair of (<package regex>, <test archive regex>).

def startswithwhich(s, prefixes):
for prefix in prefixes:
if s.startswith(prefix):
return prefix


JOB_DETAILS = {
'android-api-16-opt': AndroidArtifactJob,
'android-api-16-debug': AndroidArtifactJob,
'android-x86-opt': AndroidArtifactJob,
'android-x86_64-opt': AndroidArtifactJob,
'android-x86_64-debug': AndroidArtifactJob,
'android-aarch64-opt': AndroidArtifactJob,
'android-aarch64-debug': AndroidArtifactJob,
'linux-opt': LinuxArtifactJob,
'linux-pgo': LinuxArtifactJob,
'linux-debug': LinuxArtifactJob,
'linux64-opt': LinuxArtifactJob,
'linux64-pgo': LinuxArtifactJob,
'linux64-debug': LinuxArtifactJob,
'macosx64-opt': MacArtifactJob,
'macosx64-debug': MacArtifactJob,
'win32-opt': WinArtifactJob,
'win32-pgo': WinArtifactJob,
'win32-debug': WinArtifactJob,
'win64-opt': WinArtifactJob,
'win64-pgo': WinArtifactJob,
'win64-debug': WinArtifactJob,
'win64-aarch64-opt': WinArtifactJob,
'win64-aarch64-debug': WinArtifactJob,
j: {
'android': AndroidArtifactJob,
'linux': LinuxArtifactJob,
'macosx': MacArtifactJob,
'win': WinArtifactJob,
}[startswithwhich(j, ('android', 'linux', 'macosx', 'win'))]
for j in JOB_CHOICES
}


@@ -34,6 +34,7 @@

from mach.main import Mach

from mozbuild.artifact_builds import JOB_CHOICES
from mozbuild.base import (
BuildEnvironmentNotFoundException,
MachCommandBase,
@@ -1185,33 +1186,6 @@ def default(self, obj):
json.dump(self, cls=EnvironmentEncoder, sort_keys=True, fp=out)


JOB_CHOICES = {
'android-api-16-opt',
'android-api-16-debug',
'android-x86-opt',
'android-x86_64-opt',
'android-x86_64-debug',
'android-aarch64-opt',
'android-aarch64-debug',
'linux-opt',
'linux-pgo',
'linux-debug',
'linux64-opt',
'linux64-pgo',
'linux64-debug',
'macosx64-opt',
'macosx64-debug',
'win32-opt',
'win32-pgo',
'win32-debug',
'win64-opt',
'win64-pgo',
'win64-debug',
'win64-aarch64-opt',
'win64-aarch64-debug',
}


class ArtifactSubCommand(SubCommand):
def __call__(self, func):
after = SubCommand.__call__(self, func)
@@ -1262,12 +1236,7 @@ def _make_artifacts(self, tree=None, job=None, skip_cache=False,
if conditions.is_git(self):
git = self.substs['GIT']

from mozbuild.artifacts import (Artifacts, JOB_DETAILS)
# We can't derive JOB_CHOICES from JOB_DETAILS because we don't want to
# import the artifacts module globally ; and this module can't be
# imported in unit tests, so do the check here.
assert set(JOB_DETAILS.keys()) == JOB_CHOICES

from mozbuild.artifacts import Artifacts
artifacts = Artifacts(tree, self.substs, self.defines, job,
log=self.log, cache_dir=cache_dir,
skip_cache=skip_cache, hg=hg, git=git,

0 comments on commit e2a098a

Please sign in to comment.
You can’t perform that action at this time.