From ab5c6917c6892b847a7559559dc2a6ae244bee52 Mon Sep 17 00:00:00 2001 From: David James Date: Thu, 9 Dec 2010 14:52:46 -0800 Subject: [PATCH] Update cbuildbot.py to use emptytree option instead of deleting board. This allows us to avoid deleting the board and still ensure our packages are in sync with the full buildbot. This allows us to detect conflicts between old and new packages. BUG=chromium-os:10127 TEST=Run cbuildbot.py with emptytree feature forced to on and verify that build_packages rebuilds all packages. Also run unit tests. Change-Id: I83e186937e28eef44285724697895a4583910b58 Review URL: http://codereview.chromium.org/5652007 --- bin/cbuildbot.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py index 2e86ae4173..8b44fdf253 100755 --- a/bin/cbuildbot.py +++ b/bin/cbuildbot.py @@ -341,10 +341,14 @@ def _SetupBoard(buildroot, board='x86-generic'): cwd=cwd, enter_chroot=True) -def _Build(buildroot): +def _Build(buildroot, emptytree): """Wrapper around build_packages.""" cwd = os.path.join(buildroot, 'src', 'scripts') - RunCommand(['./build_packages'], cwd=cwd, enter_chroot=True) + cmd = ['./build_packages'] + if emptytree: + cmd.insert(0, 'EXTRA_BOARD_FLAGS=--emptytree') + + RunCommand(cmd, cwd=cwd, enter_chroot=True) def _BuildChrome(buildroot, board, chrome_atom_to_build): @@ -646,8 +650,7 @@ def main(): _IncrementalCheckout(buildroot) new_binhost = _GetPortageEnvVar(buildroot, board, _FULL_BINHOST) - if old_binhost and old_binhost != new_binhost: - RunCommand(['sudo', 'rm', '-rf', boardpath]) + emptytree = (old_binhost and old_binhost != new_binhost) # Check that all overlays can be found. for path in rev_overlays: @@ -671,7 +674,7 @@ def main(): _EnableLocalAccount(buildroot) # Doesn't rebuild without acquiring more source. if options.sync: - _Build(buildroot) + _Build(buildroot, emptytree) if chrome_atom_to_build: _BuildChrome(buildroot, buildconfig['board'], chrome_atom_to_build)