Update setup_cros_cargo.sh to fix all paths for chromeos cargo builds

This allows ChromeOS developers to use cargo to build against the crates
provided by the ChromeOS source tree, instead of using the bundled
submodules.

BUG=b:196585250
TEST=./setup_cros_cargo.sh && cargo build

Change-Id: I02d38784f7a97657c37c267818499efed4ddab47
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3092414
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
Dennis Kempin 2021-08-13 10:43:07 -07:00 committed by Commit Bot
parent 218c8f313e
commit faee6ce7fa

View file

@ -8,7 +8,16 @@
#
# TODO(b/194323235): Add documentation for ChromeOS developer workflows.
sed -i 's|path = "libcras_stub"|path = "../../third_party/adhd/cras/client/libcras"|g' \
declare -A replacements=(
["libcras_stub"]="../../third_party/adhd/cras/client/libcras"
["third_party/minijail"]="../../aosp/external/minijail"
["third_party/vmm_vhost"]="../../third_party/rust-vmm/vhost"
)
for crate in "${!replacements[@]}"; do
echo "Replacing '${crate}' with '${replacements[$crate]}'"
sed -i "s|path = \"${crate}|path = \"${replacements[$crate]}|g" \
Cargo.toml
done
echo "Modified Cargo.toml with new paths. Please do not commit those."