File: build-std-detect.sh

package info (click to toggle)
rustc 1.86.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid
  • size: 913,560 kB
  • sloc: xml: 158,127; python: 35,921; javascript: 19,689; sh: 19,600; cpp: 18,906; ansic: 13,124; asm: 4,376; makefile: 708; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (40 lines) | stat: -rwxr-xr-x 921 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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