@@ -11,7 +11,9 @@ OS=${TRAVIS_OS_NAME}
11
11
echo " Testing Rust ${RUST} on ${OS} "
12
12
13
13
test_target () {
14
- TARGET=" ${1} "
14
+ CARGO=" ${1} "
15
+ TARGET=" ${2} "
16
+ NO_STD=" ${3} "
15
17
16
18
opt=
17
19
if [ " ${TARGET} " = " x86_64-unknown-linux-gnux32" ]; then
@@ -22,31 +24,38 @@ test_target() {
22
24
opt=" --release"
23
25
fi
24
26
25
- NO_STD=
26
- case ${TARGET} in
27
- thumbv* )
28
- NO_STD=1
29
- ;;
30
- esac
31
-
32
- rustup target add " ${TARGET} " --toolchain " ${RUST} " || true
27
+ # If there is a std component, fetch it:
28
+ if [ " ${NO_STD} " != " 1" ]; then
29
+ # FIXME: rustup often fails to download some artifacts due to network
30
+ # issues, so we retry this N times.
31
+ N=5
32
+ n=0
33
+ until [ $n -ge $N ]
34
+ do
35
+ if rustup target add " ${TARGET} " --toolchain " ${RUST} " ; then
36
+ break
37
+ fi
38
+ n=$(( n+ 1 ))
39
+ sleep 1
40
+ done
41
+ fi
33
42
34
43
# Test that libc builds without any default features (no libstd)
35
- cargo " +${RUST} " build -vv $opt --no-default-features --target " ${TARGET} "
44
+ " $CARGO " " +${RUST} " build -vv $opt --no-default-features --target " ${TARGET} "
36
45
37
46
# Test that libc builds with default features (e.g. libstd)
38
47
# if the target supports libstd
39
48
if [ " $NO_STD " != " 1" ]; then
40
- cargo " +${RUST} " build -vv $opt --target " ${TARGET} "
49
+ " $CARGO " " +${RUST} " build -vv $opt --target " ${TARGET} "
41
50
fi
42
51
43
52
# Test that libc builds with the `extra_traits` feature
44
- cargo " +${RUST} " build -vv $opt --no-default-features --target " ${TARGET} " \
53
+ " $CARGO " " +${RUST} " build -vv $opt --no-default-features --target " ${TARGET} " \
45
54
--features extra_traits
46
55
47
56
# Also test that it builds with `extra_traits` and default features:
48
57
if [ " $NO_STD " != " 1" ]; then
49
- cargo " +${RUST} " build -vv $opt --target " ${TARGET} " \
58
+ " $CARGO " " +${RUST} " build -vv $opt --target " ${TARGET} " \
50
59
--features extra_traits
51
60
fi
52
61
}
@@ -103,24 +112,15 @@ x86_64-unknown-cloudabi \
103
112
104
113
RUST_NIGHTLY_LINUX_TARGETS=" \
105
114
aarch64-fuchsia \
106
- thumbv6m-none-eabi \
107
- thumbv7em-none-eabi \
108
- thumbv7em-none-eabihf \
109
- thumbv7m-none-eabi \
110
- thumbv7neon-linux-androideabi \
111
- thumbv7neon-unknown-linux-gnueabihf \
115
+ armv5te-unknown-linux-gnueabi \
116
+ armv5te-unknown-linux-musleabi \
117
+ i686-pc-windows-gnu \
112
118
x86_64-fortanix-unknown-sgx \
113
119
x86_64-fuchsia \
120
+ x86_64-pc-windows-gnu \
114
121
x86_64-unknown-linux-gnux32 \
115
122
x86_64-unknown-redox \
116
123
"
117
- # FIXME: these do not have a rust-std component available
118
- # aarch64-unknown-cloudabi armv7-unknown-cloudabi-eabihf
119
- # i686-unknown-cloudabi powerpc-unknown-linux-gnuspe
120
- # sparc-unknown-linux-gnu mips-unknown-linux-uclib
121
- # i686-unknown-haiku mipsel-unknown-unknown-linux-uclib
122
- # sparc64-unknown-netbsd x86_64-unknown-bitrig x86_64-unknown-haiku
123
- # x86_64-unknown-openbsd i686-unknown-netbsd
124
124
125
125
RUST_OSX_TARGETS=" \
126
126
aarch64-apple-ios \
@@ -161,5 +161,45 @@ case "${OS}" in
161
161
esac
162
162
163
163
for TARGET in $TARGETS ; do
164
- test_target " $TARGET "
164
+ test_target cargo " $TARGET "
165
165
done
166
+
167
+ # FIXME: https://github.com/rust-lang/rust/issues/58564
168
+ # sparc-unknown-linux-gnu
169
+ RUST_LINUX_NO_CORE_TARGETS=" \
170
+ x86_64-unknown-dragonfly \
171
+ aarch64-pc-windows-msvc \
172
+ aarch64-unknown-cloudabi \
173
+ armebv7r-none-eabi \
174
+ armebv7r-none-eabihf \
175
+ armv7-unknown-cloudabi-eabihf \
176
+ armv7r-none-eabi \
177
+ armv7r-none-eabihf \
178
+ i586-pc-windows-msvc \
179
+ i686-pc-windows-msvc \
180
+ i686-unknown-cloudabi \
181
+ i686-unknown-haiku \
182
+ i686-unknown-netbsd \
183
+ nvptx64-nvidia-cuda \
184
+ powerpc-unknown-linux-gnuspe \
185
+ riscv32imac-unknown-none-elf \
186
+ riscv32imc-unknown-none-elf \
187
+ sparc64-unknown-netbsd \
188
+ thumbv6m-none-eabi \
189
+ thumbv7em-none-eabi \
190
+ thumbv7em-none-eabihf \
191
+ thumbv7m-none-eabi \
192
+ thumbv7neon-linux-androideabi \
193
+ thumbv7neon-unknown-linux-gnueabihf \
194
+ thumbv8m.main-none-eabi \
195
+ x86_64-pc-windows-msvc
196
+ x86_64-unknown-bitrig \
197
+ x86_64-unknown-haiku \
198
+ x86_64-unknown-openbsd
199
+ "
200
+
201
+ if [ " ${RUST} " = " nightly" ] && [ " ${OS} " = " linux" ]; then
202
+ for TARGET in $RUST_LINUX_NO_CORE_TARGETS ; do
203
+ test_target xargo " $TARGET " 1
204
+ done
205
+ fi
0 commit comments