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
This commit is contained in:
David James 2010-12-09 14:52:46 -08:00
parent 53ac954a36
commit ab5c6917c6

View File

@ -341,10 +341,14 @@ def _SetupBoard(buildroot, board='x86-generic'):
cwd=cwd, enter_chroot=True) cwd=cwd, enter_chroot=True)
def _Build(buildroot): def _Build(buildroot, emptytree):
"""Wrapper around build_packages.""" """Wrapper around build_packages."""
cwd = os.path.join(buildroot, 'src', 'scripts') 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): def _BuildChrome(buildroot, board, chrome_atom_to_build):
@ -646,8 +650,7 @@ def main():
_IncrementalCheckout(buildroot) _IncrementalCheckout(buildroot)
new_binhost = _GetPortageEnvVar(buildroot, board, _FULL_BINHOST) new_binhost = _GetPortageEnvVar(buildroot, board, _FULL_BINHOST)
if old_binhost and old_binhost != new_binhost: emptytree = (old_binhost and old_binhost != new_binhost)
RunCommand(['sudo', 'rm', '-rf', boardpath])
# Check that all overlays can be found. # Check that all overlays can be found.
for path in rev_overlays: for path in rev_overlays:
@ -671,7 +674,7 @@ def main():
_EnableLocalAccount(buildroot) _EnableLocalAccount(buildroot)
# Doesn't rebuild without acquiring more source. # Doesn't rebuild without acquiring more source.
if options.sync: if options.sync:
_Build(buildroot) _Build(buildroot, emptytree)
if chrome_atom_to_build: if chrome_atom_to_build:
_BuildChrome(buildroot, buildconfig['board'], chrome_atom_to_build) _BuildChrome(buildroot, buildconfig['board'], chrome_atom_to_build)