-
Notifications
You must be signed in to change notification settings - Fork 292
/
run.sh
50 lines (40 loc) · 1.38 KB
/
run.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env sh
set -ex
: "${TARGET?The TARGET environment variable must be set.}"
if [ "${NO_STD}" = "1" ]; then
# Unfortunately serde currently doesn't work without std due to a cargo bug.
FEATURES="rustc-internal-api"
OP="build"
else
FEATURES="rustc-internal-api,serde,rayon,raw"
OP="test"
fi
if [ "${CHANNEL}" = "nightly" ]; then
FEATURES="${FEATURES},nightly"
export RUSTFLAGS="$RUSTFLAGS -D warnings"
fi
if [ "${CHANNEL}" = "1.63.0" ]; then
cargo update --package allocator-api2 --precise 0.2.9
fi
CARGO=cargo
if [ "${CROSS}" = "1" ]; then
export CARGO_NET_RETRY=5
export CARGO_NET_TIMEOUT=10
cargo install --locked cross
CARGO=cross
fi
# Make sure we can compile without the default hasher
"${CARGO}" -vv build --target="${TARGET}" --no-default-features
"${CARGO}" -vv build --target="${TARGET}" --release --no-default-features
"${CARGO}" -vv ${OP} --target="${TARGET}"
"${CARGO}" -vv ${OP} --target="${TARGET}" --features "${FEATURES}"
"${CARGO}" -vv ${OP} --target="${TARGET}" --release
"${CARGO}" -vv ${OP} --target="${TARGET}" --release --features "${FEATURES}"
if [ "${CHANNEL}" = "nightly" ] && [ "${NO_STD}" != 1 ]; then
# Run benchmark on native targets, build them on non-native ones:
NO_RUN=""
if [ "${CROSS}" = "1" ]; then
NO_RUN="--no-run"
fi
"${CARGO}" -vv bench "${NO_RUN}" --features "${FEATURES}"
fi