mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-17 15:06:06 +00:00
ci: Build std_detect on non-Linux & non-x86 targets
This commit is contained in:
parent
38c1a16190
commit
24e69958b6
10
library/stdarch/.github/workflows/main.yml
vendored
10
library/stdarch/.github/workflows/main.yml
vendored
@ -211,3 +211,13 @@ jobs:
|
||||
if: "matrix.os == 'ubuntu-latest' && !startsWith(matrix.target, 'thumb')"
|
||||
env:
|
||||
TARGET: ${{ matrix.target }}
|
||||
|
||||
build-std-detect:
|
||||
needs: [style]
|
||||
name: Build std_detect
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Install Rust
|
||||
run: rustup update nightly && rustup default nightly
|
||||
- run: ./ci/build-std-detect.sh
|
||||
|
||||
40
library/stdarch/ci/build-std-detect.sh
Executable file
40
library/stdarch/ci/build-std-detect.sh
Executable file
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user