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

Side by Side Diff: bin/cbuildbot.py

Issue 6339018: Revert "Have the ability for the PFQ to both rev Chrome and ..." (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Put the right revert patch 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | bin/cbuildbot_config.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """CBuildbot is wrapper around the build process used by the pre-flight queue""" 7 """CBuildbot is wrapper around the build process used by the pre-flight queue"""
8 8
9 import errno 9 import errno
10 import heapq 10 import heapq
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 320
321 def _IncrementalCheckout(buildroot, retries=_DEFAULT_RETRIES): 321 def _IncrementalCheckout(buildroot, retries=_DEFAULT_RETRIES):
322 """Performs a checkout without clobbering previous checkout.""" 322 """Performs a checkout without clobbering previous checkout."""
323 RepoSync(buildroot, retries) 323 RepoSync(buildroot, retries)
324 324
325 325
326 def _MakeChroot(buildroot, replace=False): 326 def _MakeChroot(buildroot, replace=False):
327 """Wrapper around make_chroot.""" 327 """Wrapper around make_chroot."""
328 cwd = os.path.join(buildroot, 'src', 'scripts') 328 cwd = os.path.join(buildroot, 'src', 'scripts')
329 329
330 cmd = ['./make_chroot', '--fast'] 330 cmd = ['./make_chroot', '--fast']
331 331
332 if replace: 332 if replace:
333 cmd.append('--replace') 333 cmd.append('--replace')
334 334
335 RunCommand(cmd, cwd=cwd) 335 RunCommand(cmd, cwd=cwd)
336 336
337 337
338 def _GetPortageEnvVar(buildroot, board, envvar): 338 def _GetPortageEnvVar(buildroot, board, envvar):
339 """Get a portage environment variable for the specified board, if any. 339 """Get a portage environment variable for the specified board, if any.
340 340
341 buildroot: The root directory where the build occurs. Must be an absolute 341 buildroot: The root directory where the build occurs. Must be an absolute
342 path. 342 path.
343 board: Board type that was built on this machine. E.g. x86-generic. If this 343 board: Board type that was built on this machine. E.g. x86-generic. If this
344 is None, get the env var from the host. 344 is None, get the env var from the host.
(...skipping 22 matching lines...) Expand all
367 def _Build(buildroot, emptytree, build_autotest=True, usepkg=True): 367 def _Build(buildroot, emptytree, build_autotest=True, usepkg=True):
368 """Wrapper around build_packages.""" 368 """Wrapper around build_packages."""
369 cwd = os.path.join(buildroot, 'src', 'scripts') 369 cwd = os.path.join(buildroot, 'src', 'scripts')
370 if emptytree: 370 if emptytree:
371 cmd = ['sh', '-c', 'EXTRA_BOARD_FLAGS=--emptytree ./build_packages'] 371 cmd = ['sh', '-c', 'EXTRA_BOARD_FLAGS=--emptytree ./build_packages']
372 else: 372 else:
373 cmd = ['./build_packages'] 373 cmd = ['./build_packages']
374 374
375 if not build_autotest: 375 if not build_autotest:
376 cmd.append('--nowithautotest') 376 cmd.append('--nowithautotest')
377 377
378 if not usepkg: 378 if not usepkg:
379 cmd.append('--nousepkg') 379 cmd.append('--nousepkg')
380 380
381 RunCommand(cmd, cwd=cwd, enter_chroot=True) 381 RunCommand(cmd, cwd=cwd, enter_chroot=True)
382 382
383 383
384 def _EnableLocalAccount(buildroot): 384 def _EnableLocalAccount(buildroot):
385 cwd = os.path.join(buildroot, 'src', 'scripts') 385 cwd = os.path.join(buildroot, 'src', 'scripts')
386 # Set local account for test images. 386 # Set local account for test images.
387 RunCommand(['./enable_localaccount.sh', 387 RunCommand(['./enable_localaccount.sh',
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 for path in rev_overlays: 731 for path in rev_overlays:
732 if not os.path.isdir(path): 732 if not os.path.isdir(path):
733 Die('Missing overlay: %s' % path) 733 Die('Missing overlay: %s' % path)
734 734
735 if not os.path.isdir(chroot_path): 735 if not os.path.isdir(chroot_path):
736 _MakeChroot(buildroot, buildconfig['chroot_replace']) 736 _MakeChroot(buildroot, buildconfig['chroot_replace'])
737 737
738 if not os.path.isdir(boardpath): 738 if not os.path.isdir(boardpath):
739 _SetupBoard(buildroot, board=buildconfig['board']) 739 _SetupBoard(buildroot, board=buildconfig['board'])
740 740
741 # Perform chrome uprev. 741 # Perform uprev. If chrome_uprev is set, rev Chrome ebuilds.
742 if options.chrome_rev: 742 if options.chrome_rev:
743 chrome_atom_to_build = _MarkChromeAsStable(buildroot, tracking_branch, 743 chrome_atom_to_build = _MarkChromeAsStable(buildroot, tracking_branch,
744 options.chrome_rev, board) 744 options.chrome_rev, board)
745 # Perform other uprevs. 745 # If we found nothing to rev, we're done here.
746 if buildconfig['uprev']: 746 if not chrome_atom_to_build:
747 return
748
749 elif buildconfig['uprev']:
747 _UprevPackages(buildroot, tracking_branch, revisionfile, 750 _UprevPackages(buildroot, tracking_branch, revisionfile,
748 buildconfig['board'], rev_overlays) 751 buildconfig['board'], rev_overlays)
749 elif not chrome_atom_to_build:
750 # We found nothing to rev, we're done here.
751 return
752 752
753 _EnableLocalAccount(buildroot) 753 _EnableLocalAccount(buildroot)
754 754
755 if options.build: 755 if options.build:
756 _Build(buildroot, 756 _Build(buildroot,
757 emptytree, 757 emptytree,
758 build_autotest=(buildconfig['vm_tests'] and options.tests), 758 build_autotest=(buildconfig['vm_tests'] and options.tests),
759 usepkg=buildconfig['usepkg']) 759 usepkg=buildconfig['usepkg'])
760 760
761 if buildconfig['unittests'] and options.tests: 761 if buildconfig['unittests'] and options.tests:
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 except: 805 except:
806 # Send failure to master bot. 806 # Send failure to master bot.
807 if not buildconfig['master'] and buildconfig['important']: 807 if not buildconfig['master'] and buildconfig['important']:
808 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) 808 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED)
809 809
810 raise 810 raise
811 811
812 812
813 if __name__ == '__main__': 813 if __name__ == '__main__':
814 main() 814 main()
OLDNEW
« 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