@@ -15,7 +15,6 @@ RUST=${TOOLCHAIN}
15
15
echo " Testing Rust ${RUST} on ${OS} "
16
16
17
17
if [ " ${TOOLCHAIN} " = " nightly" ] ; then
18
- cargo +nightly install cargo-xbuild
19
18
rustup component add rust-src
20
19
fi
21
20
@@ -41,29 +40,46 @@ test_target() {
41
40
fi
42
41
43
42
# Test that libc builds without any default features (no libstd)
44
- cargo " +${RUST} " " ${BUILD_CMD} " -vv --no-default-features --target " ${TARGET} "
45
-
43
+ if [ " ${NO_STD} " != " 1" ]; then
44
+ cargo " +${RUST} " " ${BUILD_CMD} " -vv --no-default-features --target " ${TARGET} "
45
+ else
46
+ cargo " +${RUST} " " ${BUILD_CMD} " -Z build-std=core,alloc -vv --no-default-features --target " ${TARGET} "
47
+ fi
46
48
# Test that libc builds with default features (e.g. libstd)
47
49
# if the target supports libstd
48
50
if [ " $NO_STD " != " 1" ]; then
49
51
cargo " +${RUST} " " ${BUILD_CMD} " -vv --target " ${TARGET} "
52
+ else
53
+ cargo " +${RUST} " " ${BUILD_CMD} " -Z build-std=core,alloc -vv --target " ${TARGET} "
50
54
fi
51
55
52
56
# Test that libc builds with the `extra_traits` feature
53
- cargo " +${RUST} " " ${BUILD_CMD} " -vv --no-default-features --target " ${TARGET} " \
57
+ if [ " ${NO_STD} " != " 1" ]; then
58
+ cargo " +${RUST} " " ${BUILD_CMD} " -vv --no-default-features --target " ${TARGET} " \
54
59
--features extra_traits
60
+ else
61
+ cargo " +${RUST} " " ${BUILD_CMD} " -Z build-std=core,alloc -vv --no-default-features \
62
+ --target " ${TARGET} " --features extra_traits
63
+ fi
55
64
56
65
# Test the 'const-extern-fn' feature on nightly
57
66
if [ " ${RUST} " = " nightly" ]; then
58
- cargo " +${RUST} " " ${BUILD_CMD} " -vv --no-default-features --target " ${TARGET} " \
59
- --features const-extern-fn
67
+ if [ " ${NO_STD} " != " 1" ]; then
68
+ cargo " +${RUST} " " ${BUILD_CMD} " -vv --no-default-features --target " ${TARGET} " \
69
+ --features const-extern-fn
70
+ else
71
+ cargo " +${RUST} " " ${BUILD_CMD} " -Z build-std=core,alloc -vv --no-default-features \
72
+ --target " ${TARGET} " --features const-extern-fn
73
+ fi
60
74
fi
61
75
62
-
63
76
# Also test that it builds with `extra_traits` and default features:
64
77
if [ " $NO_STD " != " 1" ]; then
65
78
cargo " +${RUST} " " ${BUILD_CMD} " -vv --target " ${TARGET} " \
66
79
--features extra_traits
80
+ else
81
+ cargo " +${RUST} " " ${BUILD_CMD} " -Z build-std=core,alloc -vv --target " ${TARGET} " \
82
+ --features extra_traits
67
83
fi
68
84
}
69
85
@@ -166,7 +182,7 @@ case "${OS}" in
166
182
esac
167
183
168
184
for TARGET in $TARGETS ; do
169
- if echo " $TARGET " | grep -q " $FILTER " ; then
185
+ if echo " $TARGET " | grep -q " $FILTER " ; then
170
186
test_target build " $TARGET "
171
187
fi
172
188
done
@@ -193,6 +209,7 @@ i686-unknown-haiku \
193
209
i686-unknown-netbsd \
194
210
i686-unknown-openbsd \
195
211
mips-unknown-linux-uclibc \
212
+ mipsel-sony-psp \
196
213
mipsel-unknown-linux-uclibc \
197
214
mips64-unknown-linux-muslabi64 \
198
215
mips64el-unknown-linux-muslabi64 \
@@ -229,13 +246,10 @@ powerpc64-wrs-vxworks \
229
246
230
247
if [ " ${RUST} " = " nightly" ] && [ " ${OS} " = " linux" ]; then
231
248
for TARGET in $RUST_LINUX_NO_CORE_TARGETS ; do
232
- if echo " $TARGET " | grep -q " $FILTER " ; then
233
- test_target xbuild " $TARGET " 1
249
+ if echo " $TARGET " | grep -q " $FILTER " ; then
250
+ test_target build " $TARGET " 1
234
251
fi
235
252
done
236
-
237
- # Sony PSP
238
- cargo xbuild --target mipsel-sony-psp
239
253
fi
240
254
241
255
RUST_OSX_NO_CORE_TARGETS=" \
@@ -248,7 +262,7 @@ i686-apple-darwin \
248
262
if [ " ${RUST} " = " nightly" ] && [ " ${OS} " = " osx" ]; then
249
263
for TARGET in $RUST_OSX_NO_CORE_TARGETS ; do
250
264
if echo " $TARGET " | grep -q " $FILTER " ; then
251
- test_target xbuild " $TARGET " 1
265
+ test_target build " $TARGET " 1
252
266
fi
253
267
done
254
268
fi
0 commit comments