Bug 1236110 - Extend mach artifact to handle Linux Desktop builds. r=gps

This commit is contained in:
Nick Alexander 2016-01-06 20:15:21 -08:00
parent 14e47fe984
commit ec8d5d4363
2 changed files with 47 additions and 5 deletions

View File

@ -50,6 +50,7 @@ import re
import shutil
import stat
import subprocess
import tarfile
import tempfile
import urlparse
import zipfile
@ -131,6 +132,41 @@ class AndroidArtifactJob(ArtifactJob):
writer.add(basename.encode('utf-8'), f)
class LinuxArtifactJob(ArtifactJob):
def process_artifact(self, filename, processed_filename):
with JarWriter(file=processed_filename, optimize=False, compress_level=5) as writer:
prefix = 'firefox/'
whitelist = {
'application.ini',
'crashreporter',
'dependentlibs.list',
'firefox',
'firefox-bin',
'platform.ini',
'plugin-container',
'updater',
'webapprt-stub',
}
with tarfile.open(filename) as reader:
for f in reader:
if not f.isfile():
continue
if not f.name.startswith(prefix):
raise ValueError('Archive format changed! Filename should start with "firefox/"; was "{filename}"'.format(filename=f.name))
basename = f.name[len(prefix):]
if not basename.endswith('.so') and \
basename not in whitelist:
continue
self.log(logging.INFO, 'artifact',
{'basename': basename},
'Adding {basename} to processed archive')
writer.add(basename.encode('utf-8'), reader.extractfile(f), mode=f.mode)
class MacArtifactJob(ArtifactJob):
def process_artifact(self, filename, processed_filename):
tempdir = tempfile.mkdtemp()
@ -249,13 +285,15 @@ class WinArtifactJob(ArtifactJob):
writer.add(basename.encode('utf-8'), f)
# Keep the keys of this map in sync with the |mach artifact| --job options.
# 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/#buildbot.branches.mozilla-central/buildbot.branches.mozilla-central.
JOB_DETAILS = {
# 'android-api-9': (AndroidArtifactJob, 'public/build/fennec-(.*)\.android-arm\.apk'),
'android-api-11': (AndroidArtifactJob, 'public/build/fennec-(.*)\.android-arm\.apk'),
'android-x86': (AndroidArtifactJob, 'public/build/fennec-(.*)\.android-i386\.apk'),
# 'linux': (ArtifactJob, 'public/build/firefox-(.*)\.linux-i686\.tar\.bz2'),
# 'linux64': (ArtifactJob, 'public/build/firefox-(.*)\.linux-x86_64\.tar\.bz2'),
'linux': (LinuxArtifactJob, 'public/build/firefox-(.*)\.linux-i686\.tar\.bz2'),
'linux64': (LinuxArtifactJob, 'public/build/firefox-(.*)\.linux-x86_64\.tar\.bz2'),
'macosx64': (MacArtifactJob, 'public/build/firefox-(.*)\.mac\.dmg'),
'win32': (WinArtifactJob, 'public/build/firefox-(.*)\.win32.zip'),
'win64': (WinArtifactJob, 'public/build/firefox-(.*)\.win64.zip'),

View File

@ -1400,6 +1400,8 @@ class ArtifactSubCommand(SubCommand):
jobchoices = {
'android-api-11',
'android-x86',
'linux',
'linux64',
'macosx64',
'win32',
'win64'
@ -1472,9 +1474,11 @@ class PackageFrontend(MachCommandBase):
if self.substs['ANDROID_CPU_ARCH'] == 'x86':
return tree, 'android-x86'
return tree, 'android-api-11'
# TODO: check for 32/64 bit builds. We'd like to use HAVE_64BIT_BUILD
# but that relies on the compile environment.
if self.defines.get('XP_LINUX', False):
return tree, 'linux64'
if self.defines.get('XP_MACOSX', False):
# TODO: check for 64 bit builds. We'd like to use HAVE_64BIT_BUILD
# but that relies on the compile environment.
return tree, 'macosx64'
if self.defines.get('XP_WIN', False):
return tree, 'win32'