summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-07-26 05:11:59 +0900
committerGitHub <noreply@github.com>2020-07-26 05:11:59 +0900
commitd706b4dbab157aef80829f137e06248dfcae1449 (patch)
treea0f2d3ed242d7ac9214a6b6993a8e2ec2b58cb9a
parentf944fce9826ba3c48c6c14bfb1c1d62578d5507f (diff)
parent45317a0c2c12b51be013cd5194dd2a89c092cb41 (diff)
downloadrust-libc-d706b4dbab157aef80829f137e06248dfcae1449.tar.gz
Merge pull request #1837 from JohnTitor/xbuild
Use `build-std` feature instead of using `cargo-xbuild`
-rw-r--r--ci/build.sh42
-rw-r--r--ci/dox.sh6
-rwxr-xr-xci/run-docker.sh3
3 files changed, 32 insertions, 19 deletions
diff --git a/ci/build.sh b/ci/build.sh
index e13dcae786..5043de8c21 100644
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -15,7 +15,6 @@ RUST=${TOOLCHAIN}
echo "Testing Rust ${RUST} on ${OS}"
if [ "${TOOLCHAIN}" = "nightly" ] ; then
- cargo +nightly install cargo-xbuild
rustup component add rust-src
fi
@@ -41,29 +40,46 @@ test_target() {
fi
# Test that libc builds without any default features (no libstd)
- cargo "+${RUST}" "${BUILD_CMD}" -vv --no-default-features --target "${TARGET}"
-
+ if [ "${NO_STD}" != "1" ]; then
+ cargo "+${RUST}" "${BUILD_CMD}" -vv --no-default-features --target "${TARGET}"
+ else
+ cargo "+${RUST}" "${BUILD_CMD}" -Z build-std=core,alloc -vv --no-default-features --target "${TARGET}"
+ fi
# Test that libc builds with default features (e.g. libstd)
# if the target supports libstd
if [ "$NO_STD" != "1" ]; then
cargo "+${RUST}" "${BUILD_CMD}" -vv --target "${TARGET}"
+ else
+ cargo "+${RUST}" "${BUILD_CMD}" -Z build-std=core,alloc -vv --target "${TARGET}"
fi
# Test that libc builds with the `extra_traits` feature
- cargo "+${RUST}" "${BUILD_CMD}" -vv --no-default-features --target "${TARGET}" \
+ if [ "${NO_STD}" != "1" ]; then
+ cargo "+${RUST}" "${BUILD_CMD}" -vv --no-default-features --target "${TARGET}" \
--features extra_traits
+ else
+ cargo "+${RUST}" "${BUILD_CMD}" -Z build-std=core,alloc -vv --no-default-features \
+ --target "${TARGET}" --features extra_traits
+ fi
# Test the 'const-extern-fn' feature on nightly
if [ "${RUST}" = "nightly" ]; then
- cargo "+${RUST}" "${BUILD_CMD}" -vv --no-default-features --target "${TARGET}" \
- --features const-extern-fn
+ if [ "${NO_STD}" != "1" ]; then
+ cargo "+${RUST}" "${BUILD_CMD}" -vv --no-default-features --target "${TARGET}" \
+ --features const-extern-fn
+ else
+ cargo "+${RUST}" "${BUILD_CMD}" -Z build-std=core,alloc -vv --no-default-features \
+ --target "${TARGET}" --features const-extern-fn
+ fi
fi
-
# Also test that it builds with `extra_traits` and default features:
if [ "$NO_STD" != "1" ]; then
cargo "+${RUST}" "${BUILD_CMD}" -vv --target "${TARGET}" \
--features extra_traits
+ else
+ cargo "+${RUST}" "${BUILD_CMD}" -Z build-std=core,alloc -vv --target "${TARGET}" \
+ --features extra_traits
fi
}
@@ -166,7 +182,7 @@ case "${OS}" in
esac
for TARGET in $TARGETS; do
- if echo "$TARGET"|grep -q "$FILTER";then
+ if echo "$TARGET"|grep -q "$FILTER"; then
test_target build "$TARGET"
fi
done
@@ -193,6 +209,7 @@ i686-unknown-haiku \
i686-unknown-netbsd \
i686-unknown-openbsd \
mips-unknown-linux-uclibc \
+mipsel-sony-psp \
mipsel-unknown-linux-uclibc \
mips64-unknown-linux-muslabi64 \
mips64el-unknown-linux-muslabi64 \
@@ -229,13 +246,10 @@ powerpc64-wrs-vxworks \
if [ "${RUST}" = "nightly" ] && [ "${OS}" = "linux" ]; then
for TARGET in $RUST_LINUX_NO_CORE_TARGETS; do
- if echo "$TARGET"|grep -q "$FILTER";then
- test_target xbuild "$TARGET" 1
+ if echo "$TARGET"|grep -q "$FILTER"; then
+ test_target build "$TARGET" 1
fi
done
-
- # Sony PSP
- cargo xbuild --target mipsel-sony-psp
fi
RUST_OSX_NO_CORE_TARGETS="\
@@ -248,7 +262,7 @@ i686-apple-darwin \
if [ "${RUST}" = "nightly" ] && [ "${OS}" = "osx" ]; then
for TARGET in $RUST_OSX_NO_CORE_TARGETS; do
if echo "$TARGET" | grep -q "$FILTER"; then
- test_target xbuild "$TARGET" 1
+ test_target build "$TARGET" 1
fi
done
fi
diff --git a/ci/dox.sh b/ci/dox.sh
index 3b15689613..67a0a75e76 100644
--- a/ci/dox.sh
+++ b/ci/dox.sh
@@ -19,7 +19,6 @@ if ! rustc --version | grep -E "nightly" ; then
fi
rustup component add rust-src
-cargo +nightly install cargo-xbuild
# List all targets that do currently build successfully:
# shellcheck disable=SC1003
@@ -50,10 +49,11 @@ while read -r target; do
# Enable extra configuration flags:
export RUSTDOCFLAGS="--cfg freebsd11"
- # If cargo doc fails, then try xargo:
+ # If cargo doc fails, then try with unstable feature:
if ! cargo doc --target "${target}" \
--no-default-features --features extra_traits ; then
- cargo xdoc --target "${target}" \
+ cargo doc --target "${target}" \
+ -Z build-std=core,alloc \
--no-default-features --features extra_traits
fi
diff --git a/ci/run-docker.sh b/ci/run-docker.sh
index 8440a002d4..648eafcd94 100755
--- a/ci/run-docker.sh
+++ b/ci/run-docker.sh
@@ -62,7 +62,6 @@ build_switch() {
kvm=""
fi
- cargo +nightly install cargo-xbuild
cp "$(which rustup)" "$(rustc --print sysroot)/bin"
docker run \
@@ -82,7 +81,7 @@ build_switch() {
libc \
sh -c "HOME=/tmp RUSTUP_HOME=/tmp PATH=\$PATH:/rust/bin rustup default nightly \
&& rustup component add rust-src --target ci/switch.json \
- && cargo xbuild --target ci/switch.json"
+ && cargo build -Z build-std=core,alloc --target ci/switch.json"
}
if [ -z "${1}" ]; then