Skip to content

Commit 778912c

Browse files
committed
Test that targets without a libstd component build on CI using xargo
1 parent d7a1995 commit 778912c

File tree

3 files changed

+95
-276
lines changed

3 files changed

+95
-276
lines changed

ci/build.sh

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ OS=${TRAVIS_OS_NAME}
1111
echo "Testing Rust ${RUST} on ${OS}"
1212

1313
test_target() {
14-
TARGET="${1}"
14+
CARGO="${1}"
15+
TARGET="${2}"
1516

1617
opt=
1718
if [ "${TARGET}" = "x86_64-unknown-linux-gnux32" ]; then
@@ -22,7 +23,7 @@ test_target() {
2223
opt="--release"
2324
fi
2425

25-
NO_STD=
26+
NO_STD="${3}"
2627
case ${TARGET} in
2728
thumbv*)
2829
NO_STD=1
@@ -32,25 +33,62 @@ test_target() {
3233
rustup target add "${TARGET}" --toolchain "${RUST}" || true
3334

3435
# Test that libc builds without any default features (no libstd)
35-
cargo "+${RUST}" build -vv $opt --no-default-features --target "${TARGET}"
36+
"$CARGO" "+${RUST}" build -vv $opt --no-default-features --target "${TARGET}"
3637

3738
# Test that libc builds with default features (e.g. libstd)
3839
# if the target supports libstd
3940
if [ "$NO_STD" != "1" ]; then
40-
cargo "+${RUST}" build -vv $opt --target "${TARGET}"
41+
"$CARGO" "+${RUST}" build -vv $opt --target "${TARGET}"
4142
fi
4243

4344
# Test that libc builds with the `extra_traits` feature
44-
cargo "+${RUST}" build -vv $opt --no-default-features --target "${TARGET}" \
45+
"$CARGO" "+${RUST}" build -vv $opt --no-default-features --target "${TARGET}" \
4546
--features extra_traits
4647

4748
# Also test that it builds with `extra_traits` and default features:
4849
if [ "$NO_STD" != "1" ]; then
49-
cargo "+${RUST}" build -vv $opt --target "${TARGET}" \
50+
"$CARGO" "+${RUST}" build -vv $opt --target "${TARGET}" \
5051
--features extra_traits
5152
fi
5253
}
5354

55+
rustup component add rust-src || true
56+
cargo install xargo || true
57+
58+
59+
RUST_LINUX_NO_CORE_TARGETS="\
60+
x86_64-unknown-dragonfly \
61+
aarch64-pc-windows-msvc \
62+
aarch64-unknown-cloudabi \
63+
armv7-unknown-cloudabi-eabihf \
64+
i586-pc-windows-msvc \
65+
i686-pc-windows-gnu \
66+
i686-pc-windows-msvc \
67+
i686-unknown-cloudabi \
68+
i686-unknown-haiku \
69+
i686-unknown-netbsd \
70+
mips-unknown-linux-uclib \
71+
mipsel-unknown-unknown-linux-uclib \
72+
nvptx64-nvidia-cuda \
73+
powerpc-unknown-linux-gnuspe \
74+
riscv32imac-unknown-none-elf \
75+
riscv32imc-unknown-none-elf \
76+
sparc-unknown-linux-gnu \
77+
sparc64-unknown-netbsd \
78+
thumbv8m.main-none-eabi \
79+
x86_64-pc-windows-gnu \
80+
x86_64-pc-windows-msvc
81+
x86_64-unknown-bitrig \
82+
x86_64-unknown-haiku \
83+
x86_64-unknown-openbsd
84+
"
85+
86+
for TARGET in $RUST_LINUX_NO_CORE_TARGETS; do
87+
if [ "${RUST}" = "nightly" ]; then
88+
RUST_LIBC_NO_CORE_BUILD=1 test_target xargo "$TARGET" 1
89+
fi
90+
done
91+
5492
RUST_LINUX_TARGETS="\
5593
aarch64-linux-android \
5694
aarch64-unknown-linux-gnu \
@@ -103,6 +141,12 @@ x86_64-unknown-cloudabi \
103141

104142
RUST_NIGHTLY_LINUX_TARGETS="\
105143
aarch64-fuchsia \
144+
armv5te-unknown-linux-gnueabi \
145+
armv5te-unknown-linux-musleabi \
146+
armebv7r-none-eabi \
147+
armebv7r-none-eabihf \
148+
armv7r-none-eabi \
149+
armv7r-none-eabihf \
106150
thumbv6m-none-eabi \
107151
thumbv7em-none-eabi \
108152
thumbv7em-none-eabihf \
@@ -161,5 +205,5 @@ case "${OS}" in
161205
esac
162206

163207
for TARGET in $TARGETS; do
164-
test_target "$TARGET"
208+
test_target cargo "$TARGET"
165209
done

src/dox.rs

Lines changed: 0 additions & 211 deletions
This file was deleted.

0 commit comments

Comments
 (0)