cros deploy: ignore built slot operator.
We don't rebuild everything for cros deploy, so ignore slot operator
to prevent dependency slot errors. Include a warning message noting
errors are expected. This is well known, but worth noting for new
people.
Also update integration test to include new message, and add a
reference to the integration tests in the file's doc block.
Add the steps to build and test an image in the test script to
make the process clear for future users.
BUG=chromium:1044346
TEST=run_tests, cros_vm_test
Change-Id: I0228ef5c21592a70dd0dbb6efb01d52cf975c35f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2032264
Tested-by: Alex Klein <saklein@chromium.org>
Auto-Submit: Alex Klein <saklein@chromium.org>
Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
Commit-Queue: Alex Klein <saklein@chromium.org>
diff --git a/cli/deploy.py b/cli/deploy.py
index e94655b..5e03429 100644
--- a/cli/deploy.py
+++ b/cli/deploy.py
@@ -3,7 +3,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Deploy packages onto a target device."""
+"""Deploy packages onto a target device.
+
+Integration tests for this file can be found at cli/cros/tests/cros_vm_tests.py.
+See that file for more information.
+"""
from __future__ import division
from __future__ import print_function
@@ -52,7 +56,9 @@
class BrilloDeployOperation(operation.ProgressBarOperation):
"""ProgressBarOperation specific for brillo deploy."""
- MERGE_EVENTS = ['NOTICE: Copying', 'NOTICE: Installing',
+ # These two variables are used to validate the output in the VM integration
+ # tests. Changes to the output must be reflected here.
+ MERGE_EVENTS = ['NOTICE: Copying', 'NOTICE: Installing', 'WARNING: Ignoring',
'emerge --usepkg', 'has been installed.']
UNMERGE_EVENTS = ['NOTICE: Unmerging', 'has been uninstalled.']
@@ -791,10 +797,18 @@
'PORTDIR': device.work_dir,
'CONFIG_PROTECT': '-*',
}
- cmd = ['emerge', '--usepkg', pkg_path, '--root=%s' % root]
+ # --ignore-built-slot-operator-deps because we don't rebuild everything.
+ # It can cause errors, but that's expected with cros deploy since it's just a
+ # best effort to prevent developers avoid rebuilding an image every time.
+ cmd = ['emerge', '--usepkg', '--ignore-built-slot-operator-deps=y', pkg_path,
+ '--root=%s' % root]
if extra_args:
cmd.append(extra_args)
+ logging.warning('Ignoring slot dependencies! This may break things! e.g. '
+ 'packages built against the old version may not be able to '
+ 'load the new .so. This is expected, and you will just need '
+ 'to build and flash a new image if you have problems.')
try:
result = device.RunCommand(cmd, extra_env=extra_env, remote_sudo=True,
capture_output=True, debug_level=logging.INFO)