fix cross-compile script to print a platform which broke the build + reuse bash for loops to optimize code boilerplate
@@ -71,29 +71,23 @@ steps:
displayName: doctests
condition: eq( variables['testKind'], 'doctests' )
- script: |
- echo "cross build" &&
- echo "https://github.com/rust-lang/cargo/issues/4753" &&
- rustup target add aarch64-fuchsia &&
- rustup target add aarch64-linux-android &&
- rustup target add i686-linux-android &&
- rustup target add i686-unknown-linux-gnu &&
- rustup target add x86_64-pc-windows-gnu &&
- rustup target add x86_64-linux-android &&
- rustup target add x86_64-fuchsia &&
- pushd crates/sled && cargo check --target aarch64-fuchsia && popd &&
- pushd crates/sled && cargo check --target aarch64-linux-android && popd &&
- pushd crates/sled && cargo check --target i686-linux-android && popd &&
- pushd crates/sled && cargo check --target i686-unknown-linux-gnu && popd &&
- pushd crates/sled && cargo check --target x86_64-pc-windows-gnu && popd &&
- pushd crates/sled && cargo check --target x86_64-linux-android && popd &&
- pushd crates/sled && cargo check --target x86_64-fuchsia && popd &&
- pushd crates/pagecache && cargo check --target aarch64-fuchsia && popd &&
- pushd crates/pagecache && cargo check --target aarch64-linux-android && popd &&
- pushd crates/pagecache && cargo check --target i686-linux-android && popd &&
- pushd crates/pagecache && cargo check --target i686-unknown-linux-gnu && popd &&
- pushd crates/pagecache && cargo check --target x86_64-pc-windows-gnu && popd &&
- pushd crates/pagecache && cargo check --target x86_64-linux-android && popd &&
- pushd crates/pagecache && cargo check --target x86_64-fuchsia && popd
+ set -eo pipefail
+ echo "cross build"
+ echo "https://github.com/rust-lang/cargo/issues/4753"
+ crates="sled pagecache"
+ targets="aarch64-fuchsia aarch64-linux-android"
+ targets="$targets i686-linux-android i686-unknown-linux-gnu"
+ targets="$targets x86_64-pc-windows-gnu x86_64-linux-android x86_64-fuchsia"
+ for crate in $crates; do
+ for target in $targets; do
+ pushd crates/$crate
+ echo "setting up $target..."
+ rustup target add $target
+ echo "checking $target..."
+ cargo check --target $target
+ popd
+ done
+ done
displayName: cross-build
condition: eq( variables['testKind'], 'cross-compile' )
- script: |
