Skip to content

Commit 6c17fc5

Browse files
committed
Auto merge of #110 - Amanieu:no_std_ci, r=Amanieu
Check in CI that the crate builds on targets without libstd Fixes #109
2 parents 167eb54 + 8a3654c commit 6c17fc5

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ matrix:
6262
- name: "aarch64-unknown-linux-gnu"
6363
env: TARGET=aarch64-unknown-linux-gnu CROSS=1
6464

65+
# Ensure that we successfully build without libstd
66+
- name: "thumbv6m-none-eabi"
67+
env: TARGET=thumbv6m-none-eabi CROSS=1 NO_STD=1
68+
6569
install: travis_retry rustup target add "${TARGET}"
6670
script: sh ci/run.sh
6771

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build = "build.rs"
1414

1515
[dependencies]
1616
# For the default hasher
17-
ahash = { version = "0.2", optional = true }
17+
ahash = { version = "0.2.9", optional = true }
1818

1919
# For external trait impls
2020
rayon = { version = "1.0", optional = true }

ci/run.sh

+15-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ set -ex
44

55
: "${TARGET?The TARGET environment variable must be set.}"
66

7-
FEATURES="rayon,serde,rustc-internal-api"
7+
if [ "${NO_STD}" = "1" ]; then
8+
# Unfortunately serde currently doesn't work without std due to a cargo bug.
9+
FEATURES="rustc-internal-api"
10+
OP="build"
11+
else
12+
FEATURES="rustc-internal-api,serde,rayon"
13+
OP="test"
14+
fi
815
if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then
916
FEATURES="${FEATURES},nightly"
1017
export RUSTFLAGS="$RUSTFLAGS -D warnings"
@@ -19,18 +26,17 @@ if [ "${CROSS}" = "1" ]; then
1926
CARGO=cross
2027
fi
2128

22-
export RUSTFLAGS="$RUSTFLAGS --cfg hashbrown_deny_warnings"
23-
2429
# Make sure we can compile without the default hasher
25-
"${CARGO}" -vv check --target="${TARGET}" --no-default-features
30+
"${CARGO}" -vv build --target="${TARGET}" --no-default-features
31+
"${CARGO}" -vv build --target="${TARGET}" --release --no-default-features
2632

27-
"${CARGO}" -vv test --target="${TARGET}"
28-
"${CARGO}" -vv test --target="${TARGET}" --features "${FEATURES}"
33+
"${CARGO}" -vv ${OP} --target="${TARGET}"
34+
"${CARGO}" -vv ${OP} --target="${TARGET}" --features "${FEATURES}"
2935

30-
"${CARGO}" -vv test --target="${TARGET}" --release
31-
"${CARGO}" -vv test --target="${TARGET}" --release --features "${FEATURES}"
36+
"${CARGO}" -vv ${OP} --target="${TARGET}" --release
37+
"${CARGO}" -vv ${OP} --target="${TARGET}" --release --features "${FEATURES}"
3238

33-
if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then
39+
if [ "${TRAVIS_RUST_VERSION}" = "nightly" ] && [ "${NO_STD}" != 1 ]; then
3440
# Run benchmark on native targets, build them on non-native ones:
3541
NO_RUN=""
3642
if [ "${CROSS}" = "1" ]; then

ci/tools.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ retry() {
1313
"$@"
1414
result=$?
1515
[ $result -eq 0 ] && break
16-
count=$(count + 1)
16+
count=$((count + 1))
1717
sleep 1
1818
done
1919

0 commit comments

Comments
 (0)