Bug 1347579 - run configure before doing repack. r=aki

MozReview-Commit-ID: 4uBwqwtN3i0

--HG--
extra : rebase_source : f067fa3b33157a1afc0906412fb7b4f7e5fe24f3
extra : intermediate-source : 727ed2b44031fd71780ed0d0c27a0950633f41dc
extra : source : dda6cc82c28204967a2012a13de9bcdaf94f9418
This commit is contained in:
Justin Wood 2017-03-28 16:26:56 -04:00
Родитель 3871b98dcf
Коммит 485886c025
3 изменённых файлов: 42 добавлений и 11 удалений

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

@ -0,0 +1,7 @@
# This mozconfig is responsible merely for getting the cross tools setup
# for repacking a .tar into a .dmg as returned from signing.
export MKFSHFS=$topsrcdir/hfsplus-tools/newfs_hfs
export DMG_TOOL=$topsrcdir/dmg/dmg
export HFS_TOOL=$topsrcdir/dmg/hfsplus
ac_add_options --disable-compile-environment

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

@ -4,6 +4,7 @@ config = {
"input_filename": "target.tar.gz",
"output_filename": "target.dmg",
"input_home": "/home/worker/workspace/inputs",
"src_mozconfig": "browser/config/mozconfigs/macosx64/repack",
# ToolTool
"tooltool_manifest_src": 'browser/config/tooltool-manifests/macosx64/cross-releng.manifest',
@ -11,9 +12,4 @@ config = {
"tooltool_bootstrap": "setup.sh",
'tooltool_script': ["/builds/tooltool.py"],
'tooltool_cache': os.environ.get('TOOLTOOL_CACHE'),
# Tools to pack a DMG
"hfs_tool": "dmg/hfsplus",
"dmg_tool": "dmg/dmg",
"mkfshfs_tool": "hfsplus-tools/newfs_hfs",
}

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

@ -3,6 +3,7 @@ import sys
sys.path.insert(1, os.path.dirname(sys.path[0])) # noqa - don't warn about imports
from mozharness.base.log import FATAL
from mozharness.base.script import BaseScript
from mozharness.mozilla.mock import ERROR_MSGS
@ -55,6 +56,8 @@ class Repackage(BaseScript):
def setup(self):
self._run_tooltool()
self._get_mozconfig()
self._run_configure()
def query_abs_dirs(self):
if self.abs_dirs:
@ -78,18 +81,12 @@ class Repackage(BaseScript):
python = self.query_exe('python2.7')
infile = os.path.join(config['input_home'], config['input_filename'])
outfile = os.path.join(dirs['abs_upload_dir'], config['output_filename'])
env = {
'HFS_TOOL': os.path.join(dirs['abs_mozilla_dir'], config['hfs_tool']),
'DMG_TOOL': os.path.join(dirs['abs_mozilla_dir'], config['dmg_tool']),
'MKFSHFS': os.path.join(dirs['abs_mozilla_dir'], config['mkfshfs_tool'])
}
command = [python, 'mach', '--log-no-times', 'repackage',
'--input', infile,
'--output', outfile]
return self.run_command(
command=command,
cwd=dirs['abs_mozilla_dir'],
partial_env=env,
halt_on_failure=True,
)
@ -116,6 +113,37 @@ class Repackage(BaseScript):
self.info(str(cmd))
self.run_command(cmd, cwd=dirs['abs_mozilla_dir'], halt_on_failure=True)
def _get_mozconfig(self):
"""assign mozconfig."""
c = self.config
dirs = self.query_abs_dirs()
abs_mozconfig_path = ''
# first determine the mozconfig path
if c.get('src_mozconfig'):
self.info('Using in-tree mozconfig')
abs_mozconfig_path = os.path.join(dirs['abs_mozilla_dir'], c['src_mozconfig'])
else:
self.fatal("'src_mozconfig' must be in the config "
"in order to determine the mozconfig.")
# print its contents
self.read_from_file(abs_mozconfig_path, error_level=FATAL)
# finally, copy the mozconfig to a path that 'mach build' expects it to be
self.copyfile(abs_mozconfig_path, os.path.join(dirs['abs_mozilla_dir'], '.mozconfig'))
def _run_configure(self):
dirs = self.query_abs_dirs()
python = self.query_exe('python2.7')
command = [python, 'mach', '--log-no-times', 'configure']
return self.run_command(
command=command,
cwd=dirs['abs_mozilla_dir'],
output_timeout=60*3,
halt_on_failure=True,
)
if __name__ == '__main__':
repack = Repackage()