forked from cbiffle/lilos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsrv-all.sh
executable file
·26 lines (22 loc) · 913 Bytes
/
msrv-all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
set -euo pipefail
jq --version
DIRS="os extra/* testsuite/stm32f4 testsuite/stm32g0 testsuite/stm32f3 examples/*/*/"
for d in $DIRS; do
pushd $d > /dev/null
VERSION=$(cargo metadata --format-version 1 \
| jq -r '.resolve.root as $root | .packages[] | select(.id == $root) | .rust_version')
TARGET=$(cargo metadata --format-version 1 \
| jq -r '.resolve.root as $root | .packages[] | select(.id == $root) | .metadata.docs.rs["default-target"]')
if [[ "$TARGET" == "null" ]]; then
echo "---- building in $d using ${VERSION} (native)"
rustup update ${VERSION}
rustup run ${VERSION} cargo check
else
echo "---- building in $d using ${VERSION} for ${TARGET}"
rustup update ${VERSION}
rustup target add --toolchain ${VERSION} ${TARGET}
rustup run ${VERSION} cargo check
fi
popd > /dev/null
done