Bug 1464235 - option to upload tup db r=mshal

MozReview-Commit-ID: JkzWTu0g41X

--HG--
extra : rebase_source : 1bd8c2dc9f99879ca05dade9c9471cec167f319a
This commit is contained in:
Sofia Carillo 2018-06-06 14:04:47 -07:00
parent 2ee83dd552
commit 61c1056c0e
3 changed files with 19 additions and 1 deletions

View File

@ -13,3 +13,4 @@ export TUP=${TOOLTOOL_DIR}/tup/tup
. "$topsrcdir/build/mozconfig.common.override" . "$topsrcdir/build/mozconfig.common.override"
ac_add_options --enable-build-backends=Tup ac_add_options --enable-build-backends=Tup
ac_add_options --upload-tup-db

View File

@ -442,6 +442,15 @@ def tup_and_sccache(tup, using_sccache):
die('Cannot use sccache with tup yet. Please disable sccache or use ' die('Cannot use sccache with tup yet. Please disable sccache or use '
'the make backend until it is supported.') 'the make backend until it is supported.')
option('--upload-tup-db', help= 'Upload the tup database from an automated build.')
@depends('--upload-tup-db')
def upload_tdb(value):
if value:
return True
set_config('UPLOAD_TUP_DB', upload_tdb)
# watchman detection # watchman detection
# ============================================================== # ==============================================================

View File

@ -7,6 +7,7 @@ from __future__ import absolute_import, unicode_literals
import os import os
import json import json
import sys import sys
import shutil
import mozpack.path as mozpath import mozpack.path as mozpath
from mozbuild import shellutil from mozbuild import shellutil
@ -277,10 +278,17 @@ class TupBackend(CommonBackend):
args += ['-j%d' % jobs] args += ['-j%d' % jobs]
else: else:
args += ['-j%d' % multiprocessing.cpu_count()] args += ['-j%d' % multiprocessing.cpu_count()]
return config.run_process(args=args, status = config.run_process(args=args,
line_handler=output.on_line, line_handler=output.on_line,
ensure_exit_code=False, ensure_exit_code=False,
append_env=self._get_mozconfig_env(config)) append_env=self._get_mozconfig_env(config))
# upload Tup db
if (not status and
self.environment.substs.get('MOZ_AUTOMATION') and self.environment.substs.get('UPLOAD_TUP_DB')):
src = mozpath.join(self.environment.topsrcdir, '.tup')
dst = mozpath.join(os.environ['UPLOAD_PATH'], 'tup_db')
shutil.make_archive(dst, 'zip', src)
return status
def _get_backend_file(self, relobjdir): def _get_backend_file(self, relobjdir):
objdir = mozpath.normpath(mozpath.join(self.environment.topobjdir, relobjdir)) objdir = mozpath.normpath(mozpath.join(self.environment.topobjdir, relobjdir))