@@ -15,7 +15,6 @@ RUST=${TOOLCHAIN}
1515echo " Testing Rust ${RUST} on ${OS} "
1616
1717if [ " ${TOOLCHAIN} " = " nightly" ] ; then
18- cargo +nightly install cargo-xbuild
1918 rustup component add rust-src
2019fi
2120
@@ -41,29 +40,46 @@ test_target() {
4140 fi
4241
4342 # 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
4648 # Test that libc builds with default features (e.g. libstd)
4749 # if the target supports libstd
4850 if [ " $NO_STD " != " 1" ]; then
4951 cargo " +${RUST} " " ${BUILD_CMD} " -vv --target " ${TARGET} "
52+ else
53+ cargo " +${RUST} " " ${BUILD_CMD} " -Z build-std=core,alloc -vv --target " ${TARGET} "
5054 fi
5155
5256 # 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} " \
5459 --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
5564
5665 # Test the 'const-extern-fn' feature on nightly
5766 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
6074 fi
6175
62-
6376 # Also test that it builds with `extra_traits` and default features:
6477 if [ " $NO_STD " != " 1" ]; then
6578 cargo " +${RUST} " " ${BUILD_CMD} " -vv --target " ${TARGET} " \
6679 --features extra_traits
80+ else
81+ cargo " +${RUST} " " ${BUILD_CMD} " -Z build-std=core,alloc -vv --target " ${TARGET} " \
82+ --features extra_traits
6783 fi
6884}
6985
@@ -166,7 +182,7 @@ case "${OS}" in
166182esac
167183
168184for TARGET in $TARGETS ; do
169- if echo " $TARGET " | grep -q " $FILTER " ; then
185+ if echo " $TARGET " | grep -q " $FILTER " ; then
170186 test_target build " $TARGET "
171187 fi
172188done
@@ -193,6 +209,7 @@ i686-unknown-haiku \
193209i686-unknown-netbsd \
194210i686-unknown-openbsd \
195211mips-unknown-linux-uclibc \
212+ mipsel-sony-psp \
196213mipsel-unknown-linux-uclibc \
197214mips64-unknown-linux-muslabi64 \
198215mips64el-unknown-linux-muslabi64 \
@@ -229,13 +246,10 @@ powerpc64-wrs-vxworks \
229246
230247if [ " ${RUST} " = " nightly" ] && [ " ${OS} " = " linux" ]; then
231248 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
234251 fi
235252 done
236-
237- # Sony PSP
238- cargo xbuild --target mipsel-sony-psp
239253fi
240254
241255RUST_OSX_NO_CORE_TARGETS=" \
@@ -248,7 +262,7 @@ i686-apple-darwin \
248262if [ " ${RUST} " = " nightly" ] && [ " ${OS} " = " osx" ]; then
249263 for TARGET in $RUST_OSX_NO_CORE_TARGETS ; do
250264 if echo " $TARGET " | grep -q " $FILTER " ; then
251- test_target xbuild " $TARGET " 1
265+ test_target build " $TARGET " 1
252266 fi
253267 done
254268fi
0 commit comments