Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1457)

Unified Diff: bin/cbuildbot.py

Issue 6245013: Add more cbuild options, revise configs (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Fix problems from review. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | bin/cbuildbot_config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cbuildbot.py
diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py
index b760e5cefcba1167a62650c8edb2e811976b5f9d..4d727e93fbc46c56608b57f0e92a45cd561d3dfc 100755
--- a/bin/cbuildbot.py
+++ b/bin/cbuildbot.py
@@ -323,10 +323,16 @@ def _IncrementalCheckout(buildroot, retries=_DEFAULT_RETRIES):
RepoSync(buildroot, retries)
-def _MakeChroot(buildroot):
+def _MakeChroot(buildroot, replace=False):
"""Wrapper around make_chroot."""
cwd = os.path.join(buildroot, 'src', 'scripts')
- RunCommand(['./make_chroot', '--fast'], cwd=cwd)
+
+ cmd = ['./make_chroot', '--fast']
+
+ if replace:
+ cmd.append('--replace')
+
+ RunCommand(cmd, cwd=cwd)
def _GetPortageEnvVar(buildroot, board, envvar):
@@ -358,7 +364,7 @@ def _SetupBoard(buildroot, board='x86-generic'):
cwd=cwd, enter_chroot=True)
-def _Build(buildroot, emptytree):
+def _Build(buildroot, emptytree, build_autotest=True, usepkg=True):
"""Wrapper around build_packages."""
cwd = os.path.join(buildroot, 'src', 'scripts')
if emptytree:
@@ -366,6 +372,12 @@ def _Build(buildroot, emptytree):
else:
cmd = ['./build_packages']
+ if not build_autotest:
+ cmd.append('--nowithautotest')
+
+ if not usepkg:
+ cmd.append('--nousepkg')
+
RunCommand(cmd, cwd=cwd, enter_chroot=True)
@@ -559,7 +571,6 @@ def _ArchiveTestResults(buildroot, board, test_results_dir,
def _GetConfig(config_name):
"""Gets the configuration for the build"""
- default = config['default']
buildconfig = {}
if not config.has_key(config_name):
Warning('Non-existent configuration specified.')
@@ -570,13 +581,7 @@ def _GetConfig(config_name):
Warning(' %s' % name)
sys.exit(1)
- buildconfig = config[config_name]
-
- for key in default.iterkeys():
- if not buildconfig.has_key(key):
- buildconfig[key] = default[key]
-
- return buildconfig
+ return config[config_name]
def _ResolveOverlays(buildroot, overlays):
@@ -644,8 +649,6 @@ def main():
parser = optparse.OptionParser(usage=usage)
parser.add_option('-a', '--acl', default='private',
help='ACL to set on GSD archives')
- parser.add_option('--archive_build', action='store_true', default=False,
- help='Run the archive_build script.')
parser.add_option('-r', '--buildroot',
help='root directory where build occurs', default=".")
parser.add_option('-n', '--buildnumber',
@@ -730,7 +733,7 @@ def main():
Die('Missing overlay: %s' % path)
if not os.path.isdir(chroot_path):
- _MakeChroot(buildroot)
+ _MakeChroot(buildroot, buildconfig['chroot_replace'])
if not os.path.isdir(boardpath):
_SetupBoard(buildroot, board=buildconfig['board'])
@@ -750,14 +753,17 @@ def main():
_EnableLocalAccount(buildroot)
if options.build:
- _Build(buildroot, emptytree)
+ _Build(buildroot,
+ emptytree,
+ build_autotest=(buildconfig['vm_tests'] and options.tests),
+ usepkg=buildconfig['usepkg'])
if buildconfig['unittests'] and options.tests:
_RunUnitTests(buildroot)
_BuildImage(buildroot)
- if buildconfig['tests'] and options.tests:
+ if buildconfig['vm_tests'] and options.tests:
_BuildVMImageForTesting(buildroot)
test_results_dir = '/tmp/run_remote_tests.%s' % options.buildnumber
try:
@@ -791,7 +797,7 @@ def main():
if buildconfig['important'] and not options.debug:
cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_COMPLETE)
- if options.archive_build:
+ if buildconfig['archive_build']:
_LegacyArchiveBuild(bot_id,
buildconfig,
options.buildnumber,
« no previous file with comments | « no previous file | bin/cbuildbot_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698