diff options
author | George Burgess IV <gbiv@google.com> | 2020-02-28 12:57:01 -0800 |
---|---|---|
committer | George Burgess <gbiv@chromium.org> | 2020-04-03 20:42:37 +0000 |
commit | 28b8f7bffbd5b63dc2b1ef24d072be65593d0fe3 (patch) | |
tree | 5ec2db533eec77e1dd185b4c7e7bf37b80c90572 /compiler_wrapper | |
parent | 2eb33cde680c9ef15b85b1244f0dde3fb6cacadb (diff) | |
download | toolchain-utils-28b8f7bffbd5b63dc2b1ef24d072be65593d0fe3.tar.gz |
compiler_wrapper: make the update script not die on missing packages
Fresh chroots might not have all of these GCCs emerged. Just `continue`
if that's not the case.
This also fixes failing lints.
BUG=None
TEST=Ran the script
Change-Id: I57a2ca72dfbaea324ddb66423294e1b4dd8989e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2080660
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Tested-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper')
-rwxr-xr-x | compiler_wrapper/update_compiler_wrapper.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/compiler_wrapper/update_compiler_wrapper.sh b/compiler_wrapper/update_compiler_wrapper.sh index 93de2be4..69484308 100755 --- a/compiler_wrapper/update_compiler_wrapper.sh +++ b/compiler_wrapper/update_compiler_wrapper.sh @@ -1,4 +1,8 @@ #!/bin/bash +# +# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. # This script rebuilds and installs compiler wrappers @@ -17,7 +21,14 @@ sudo cp ../binary_search_tool/bisect_driver.py /usr/bin echo "/usr/bin/clang_host_wrapper/bisect_driver.py" # Update the target wrappers for GCC in cross-x86_64-cros-linux-gnu/gcc cross-armv7a-cros-linux-gnueabihf/gcc cross-aarch64-cros-linux-gnu/gcc; do - FILES="$(equery f $GCC)" + if ! FILES="$(equery f $GCC)"; then + if equery l "${GCC}" 2>&1 | grep -q "No installed packages"; then + echo "no $GCC package found; skipping" >&2 + continue + fi + # Something went wrong, and the equery above probably diagnosed it. + exit 1 + fi ./build.py --config=cros.hardened --use_ccache=false --use_llvm_next=false --output_file=./sysroot_wrapper.hardened.noccache sudo mv ./sysroot_wrapper.hardened.noccache "$(grep sysroot_wrapper.hardened.noccache <<< "${FILES}")" echo "$(grep sysroot_wrapper.hardened.noccache <<< "${FILES}")" |