summaryrefslogtreecommitdiffstats
path: root/library/stdarch/ci/build-std-detect.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:42 +0000
commit837b550238aa671a591ccf282dddeab29cadb206 (patch)
tree914b6b8862bace72bd3245ca184d374b08d8a672 /library/stdarch/ci/build-std-detect.sh
parentAdding debian version 1.70.0+dfsg2-1. (diff)
downloadrustc-837b550238aa671a591ccf282dddeab29cadb206.tar.xz
rustc-837b550238aa671a591ccf282dddeab29cadb206.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/stdarch/ci/build-std-detect.sh')
-rwxr-xr-xlibrary/stdarch/ci/build-std-detect.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/library/stdarch/ci/build-std-detect.sh b/library/stdarch/ci/build-std-detect.sh
new file mode 100755
index 000000000..e4560b337
--- /dev/null
+++ b/library/stdarch/ci/build-std-detect.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+# Build std_detect on non-Linux & non-x86 targets.
+#
+# In std_detect, non-x86 targets have OS-specific implementations,
+# but we can test only Linux in CI. This script builds targets supported
+# by std_detect but cannot be tested in CI.
+
+set -ex
+cd "$(dirname "$0")"/..
+
+targets=(
+ # Android
+ aarch64-linux-android
+ arm-linux-androideabi
+
+ # FreeBSD
+ aarch64-unknown-freebsd
+ armv6-unknown-freebsd
+ powerpc-unknown-freebsd
+ powerpc64-unknown-freebsd
+
+ # OpenBSD
+ aarch64-unknown-openbsd
+
+ # Windows
+ aarch64-pc-windows-msvc
+)
+
+rustup component add rust-src # for -Z build-std
+
+cd crates/std_detect
+for target in "${targets[@]}"; do
+ if rustup target add "${target}" &>/dev/null; then
+ cargo build --target "${target}"
+ else
+ # tier 3 targets requires -Z build-std.
+ cargo build -Z build-std="core,alloc" --target "${target}"
+ fi
+done