scripts: Fix feature build for aarch64 and mshv builds

These were erroneously skipping features for the unit tests and the
"build" target for dev_cli.sh

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-03-28 12:09:02 +01:00 committed by Bo Chen
parent 6eb47bdb03
commit fa7487629f
2 changed files with 4 additions and 6 deletions

View File

@ -270,8 +270,6 @@ cmd_build() {
cargo_args=("$@")
[ $build = "release" ] && cargo_args+=("--release")
cargo_args+=(--target "$target")
[ "$(uname -m)" = "aarch64" ] && cargo_args+=("--no-default-features")
[ "$(uname -m)" = "aarch64" ] && cargo_args+=(--features "$hypervisor")
rustflags=""
target_cc=""

View File

@ -1,16 +1,16 @@
#!/bin/bash
source $HOME/.cargo/env
source $(dirname "$0")/test-util.sh
source $(dirname "$0")/test-util.sh
process_common_args "$@"
BUILD_TARGET=${BUILD_TARGET-x86_64-unknown-linux-gnu}
cargo_args=("")
if [[ $(uname -m) = "aarch64" || $hypervisor = "mshv" ]]; then
if [[ $hypervisor = "mshv" ]]; then
cargo_args+=("--no-default-features")
cargo_args+=("--features $hypervisor")
cargo_args+=("--features common,$hypervisor")
fi
if [[ "${BUILD_TARGET}" == "aarch64-unknown-linux-musl" ]]; then
@ -19,4 +19,4 @@ if [[ "${BUILD_TARGET}" == "aarch64-unknown-linux-musl" ]]; then
fi
export RUST_BACKTRACE=1
cargo test --lib --bins --target $BUILD_TARGET --workspace ${cargo_args[@]} || exit 1;
cargo test --lib --bins --target $BUILD_TARGET --workspace ${cargo_args[@]} || exit 1