Bug 1347579 - run configure before doing repack. r=aki
MozReview-Commit-ID: 4uBwqwtN3i0
This commit is contained in:
7
browser/config/mozconfigs/macosx64/repack
Normal file
7
browser/config/mozconfigs/macosx64/repack
Normal file
@@ -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",
|
"input_filename": "target.tar.gz",
|
||||||
"output_filename": "target.dmg",
|
"output_filename": "target.dmg",
|
||||||
"input_home": "/home/worker/workspace/inputs",
|
"input_home": "/home/worker/workspace/inputs",
|
||||||
|
"src_mozconfig": "browser/config/mozconfigs/macosx64/repack",
|
||||||
|
|
||||||
# ToolTool
|
# ToolTool
|
||||||
"tooltool_manifest_src": 'browser/config/tooltool-manifests/macosx64/cross-releng.manifest',
|
"tooltool_manifest_src": 'browser/config/tooltool-manifests/macosx64/cross-releng.manifest',
|
||||||
@@ -11,9 +12,4 @@ config = {
|
|||||||
"tooltool_bootstrap": "setup.sh",
|
"tooltool_bootstrap": "setup.sh",
|
||||||
'tooltool_script': ["/builds/tooltool.py"],
|
'tooltool_script': ["/builds/tooltool.py"],
|
||||||
'tooltool_cache': os.environ.get('TOOLTOOL_CACHE'),
|
'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
|
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.base.script import BaseScript
|
||||||
from mozharness.mozilla.mock import ERROR_MSGS
|
from mozharness.mozilla.mock import ERROR_MSGS
|
||||||
|
|
||||||
@@ -55,6 +56,8 @@ class Repackage(BaseScript):
|
|||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
self._run_tooltool()
|
self._run_tooltool()
|
||||||
|
self._get_mozconfig()
|
||||||
|
self._run_configure()
|
||||||
|
|
||||||
def query_abs_dirs(self):
|
def query_abs_dirs(self):
|
||||||
if self.abs_dirs:
|
if self.abs_dirs:
|
||||||
@@ -78,18 +81,12 @@ class Repackage(BaseScript):
|
|||||||
python = self.query_exe('python2.7')
|
python = self.query_exe('python2.7')
|
||||||
infile = os.path.join(config['input_home'], config['input_filename'])
|
infile = os.path.join(config['input_home'], config['input_filename'])
|
||||||
outfile = os.path.join(dirs['abs_upload_dir'], config['output_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',
|
command = [python, 'mach', '--log-no-times', 'repackage',
|
||||||
'--input', infile,
|
'--input', infile,
|
||||||
'--output', outfile]
|
'--output', outfile]
|
||||||
return self.run_command(
|
return self.run_command(
|
||||||
command=command,
|
command=command,
|
||||||
cwd=dirs['abs_mozilla_dir'],
|
cwd=dirs['abs_mozilla_dir'],
|
||||||
partial_env=env,
|
|
||||||
halt_on_failure=True,
|
halt_on_failure=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -116,6 +113,37 @@ class Repackage(BaseScript):
|
|||||||
self.info(str(cmd))
|
self.info(str(cmd))
|
||||||
self.run_command(cmd, cwd=dirs['abs_mozilla_dir'], halt_on_failure=True)
|
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__':
|
if __name__ == '__main__':
|
||||||
repack = Repackage()
|
repack = Repackage()
|
||||||
|
|||||||
Reference in New Issue
Block a user