OLD | NEW |
1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Module containing the various stages that a builder runs.""" | 5 """Module containing the various stages that a builder runs.""" |
6 | 6 |
7 import os | 7 import os |
8 import re | 8 import re |
9 import sys | 9 import sys |
10 import tempfile | 10 import tempfile |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 class BuildTargetStage(BuilderStage): | 383 class BuildTargetStage(BuilderStage): |
384 """This stage builds Chromium OS for a target. | 384 """This stage builds Chromium OS for a target. |
385 | 385 |
386 Specifically, we build Chromium OS packages and perform imaging to get | 386 Specifically, we build Chromium OS packages and perform imaging to get |
387 the images we want per the build spec.""" | 387 the images we want per the build spec.""" |
388 def _PerformStage(self): | 388 def _PerformStage(self): |
389 BuilderStage.new_binhost = self._GetPortageEnvVar(_FULL_BINHOST) | 389 BuilderStage.new_binhost = self._GetPortageEnvVar(_FULL_BINHOST) |
390 emptytree = (BuilderStage.old_binhost and | 390 emptytree = (BuilderStage.old_binhost and |
391 BuilderStage.old_binhost != BuilderStage.new_binhost) | 391 BuilderStage.old_binhost != BuilderStage.new_binhost) |
| 392 env=None |
| 393 if self._build_config.get('useflags'): |
| 394 env={'USE' : ' '.join(self._build_config['useflags'])} |
392 | 395 |
393 commands.Build( | 396 commands.Build( |
394 self._build_root, emptytree, usepkg=self._build_config['usepkg'], | 397 self._build_root, emptytree, usepkg=self._build_config['usepkg'], |
395 build_autotest=(self._build_config['vm_tests'] and self._options.tests)) | 398 build_autotest=(self._build_config['vm_tests'] and self._options.tests), |
| 399 extra_env=env) |
396 | 400 |
397 # TODO(sosa): Do this optimization in a better way. | 401 # TODO(sosa): Do this optimization in a better way. |
398 if self._build_type == 'full': | 402 if self._build_type == 'full': |
399 commands.UploadPrebuilts( | 403 commands.UploadPrebuilts( |
400 self._build_root, self._build_config['board'], | 404 self._build_root, self._build_config['board'], |
401 self._build_config['rev_overlays'], [], self._build_type, | 405 self._build_config['rev_overlays'], [], self._build_type, |
402 False) | 406 False) |
403 | 407 |
404 commands.BuildImage(self._build_root) | 408 commands.BuildImage(self._build_root, extra_env=env) |
405 | 409 |
406 if self._build_config['vm_tests']: | 410 if self._build_config['vm_tests']: |
407 commands.BuildVMImageForTesting(self._build_root) | 411 commands.BuildVMImageForTesting(self._build_root, extra_env=env) |
408 | 412 |
409 | 413 |
410 class TestStage(BuilderStage): | 414 class TestStage(BuilderStage): |
411 """Stage that performs testing steps.""" | 415 """Stage that performs testing steps.""" |
412 def _CreateTestRoot(self): | 416 def _CreateTestRoot(self): |
413 """Returns a temporary directory for test results in chroot. | 417 """Returns a temporary directory for test results in chroot. |
414 | 418 |
415 Returns relative path from chroot rather than whole path. | 419 Returns relative path from chroot rather than whole path. |
416 """ | 420 """ |
417 # Create test directory within tmp in chroot. | 421 # Create test directory within tmp in chroot. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 def _PerformStage(self): | 466 def _PerformStage(self): |
463 if self._build_type in ('preflight', 'chrome'): | 467 if self._build_type in ('preflight', 'chrome'): |
464 commands.UploadPrebuilts( | 468 commands.UploadPrebuilts( |
465 self._build_root, self._build_config['board'], | 469 self._build_root, self._build_config['board'], |
466 self._build_config['rev_overlays'], [BuilderStage.new_binhost], | 470 self._build_config['rev_overlays'], [BuilderStage.new_binhost], |
467 self._build_type, self._options.chrome_rev) | 471 self._build_type, self._options.chrome_rev) |
468 | 472 |
469 commands.UprevPush(self._build_root, self._options.tracking_branch, | 473 commands.UprevPush(self._build_root, self._options.tracking_branch, |
470 self._build_config['board'], BuilderStage.push_overlays, | 474 self._build_config['board'], BuilderStage.push_overlays, |
471 self._options.debug) | 475 self._options.debug) |
OLD | NEW |