Skip to content

Commit 804cef7

Browse files
committed
Auto merge of #2640 - skrap:master, r=Amanieu
add CI for armv7-unknown-linux-uclibceabihf As discussed in #2636, this is a framework for CI on targets with no prebuilt std. They will build via `nightly` and `-Zbuild-std`, and run the unit tests via qemu-user (or whatever else the dockerfile specifies). It seems like I could write some more documentation about how to add more targets of this type, but perhaps I can get a round of feedback on the mechanism here before I go and write that.
2 parents 72e4151 + d93b11d commit 804cef7

File tree

4 files changed

+35
-9
lines changed

4 files changed

+35
-9
lines changed

.github/workflows/bors.yml

+25
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,29 @@ jobs:
151151
- name: Execute run-docker.sh
152152
run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
153153

154+
# These targets are tier 3 or otherwise need to have CI build std via -Zbuild-std.
155+
# Because of this, only the nightly compiler can be used on these targets.
156+
docker_linux_build_std:
157+
name: Docker Linux Build-Std Targets
158+
needs: [docker_linux_tier1, style_check]
159+
runs-on: ubuntu-20.04
160+
strategy:
161+
fail-fast: true
162+
max-parallel: 12
163+
matrix:
164+
target: [
165+
armv7-unknown-linux-uclibceabihf
166+
]
167+
steps:
168+
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
169+
with:
170+
github_token: "${{ secrets.GITHUB_TOKEN }}"
171+
- uses: actions/checkout@v2
172+
- name: Setup Rust toolchain
173+
run: TOOLCHAIN=nightly sh ./ci/install-rust.sh
174+
- name: Execute run-docker.sh
175+
run: LIBC_CI=1 TOOLCHAIN=nightly LIBC_CI_ZBUILD_STD=1 sh ./ci/run-docker.sh ${{ matrix.target }}
176+
154177
# devkitpro's pacman needs to be connected from Docker.
155178
docker_switch:
156179
name: Docker Switch
@@ -301,6 +324,7 @@ jobs:
301324
needs: [
302325
docker_linux_tier1,
303326
docker_linux_tier2,
327+
docker_linux_build_std,
304328
macos,
305329
windows,
306330
style_check,
@@ -322,6 +346,7 @@ jobs:
322346
needs: [
323347
docker_linux_tier1,
324348
docker_linux_tier2,
349+
docker_linux_build_std,
325350
macos,
326351
windows,
327352
style_check,

ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ RUN /toolchain/relocate-sdk.sh
1212

1313
ENV PATH=$PATH:/rust/bin:/toolchain/bin \
1414
STAGING_DIR=/toolchain/armv7-buildroot-linux-uclibceabihf/sysroot \
15-
CC_armv7_unknown_linux_uclibc=armv7-buildroot-linux-uclibc-gcc \
16-
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_LINKER=armv7-buildroot-linux-uclibc-gcc \
15+
CC_armv7_unknown_linux_uclibceabihf=arm-buildroot-linux-uclibcgnueabihf-gcc \
16+
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_LINKER=arm-buildroot-linux-uclibcgnueabihf-gcc \
1717
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABIHF_RUNNER="qemu-arm -L /toolchain/arm-buildroot-linux-uclibcgnueabihf/sysroot/"

ci/run-docker.sh

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ run() {
3737
--rm \
3838
--user "$(id -u)":"$(id -g)" \
3939
--env LIBC_CI \
40+
--env LIBC_CI_ZBUILD_STD \
4041
--env CARGO_HOME=/cargo \
4142
--env CARGO_TARGET_DIR=/checkout/target \
4243
--volume "$CARGO_HOME":/cargo \

ci/run.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if [ "$QEMU" != "" ]; then
5353
cargo build \
5454
--manifest-path libc-test/Cargo.toml \
5555
--target "${TARGET}" \
56-
--test main
56+
--test main ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}
5757
rm "${CARGO_TARGET_DIR}/${TARGET}"/debug/main-*.d
5858
cp "${CARGO_TARGET_DIR}/${TARGET}"/debug/main-* "${tmpdir}"/mount/libc-test
5959
# shellcheck disable=SC2016
@@ -91,17 +91,17 @@ if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then
9191
until [ $n -ge $N ]
9292
do
9393
if [ "$passed" = "0" ]; then
94-
if cargo test --no-default-features --manifest-path libc-test/Cargo.toml --target "${TARGET}" ; then
94+
if cargo test --no-default-features --manifest-path libc-test/Cargo.toml --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"} ; then
9595
passed=$((passed+1))
9696
continue
9797
fi
9898
elif [ "$passed" = "1" ]; then
99-
if cargo test --manifest-path libc-test/Cargo.toml --target "${TARGET}" ; then
99+
if cargo test --manifest-path libc-test/Cargo.toml --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"} ; then
100100
passed=$((passed+1))
101101
continue
102102
fi
103103
elif [ "$passed" = "2" ]; then
104-
if cargo test --features extra_traits --manifest-path libc-test/Cargo.toml --target "${TARGET}"; then
104+
if cargo test --features extra_traits --manifest-path libc-test/Cargo.toml --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}; then
105105
break
106106
fi
107107
fi
@@ -110,10 +110,10 @@ if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then
110110
done
111111
else
112112
cargo test --no-default-features --manifest-path libc-test/Cargo.toml \
113-
--target "${TARGET}"
113+
--target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}
114114

115-
cargo test --manifest-path libc-test/Cargo.toml --target "${TARGET}"
115+
cargo test --manifest-path libc-test/Cargo.toml --target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}
116116

117117
RUST_BACKTRACE=1 cargo test --features extra_traits --manifest-path libc-test/Cargo.toml \
118-
--target "${TARGET}"
118+
--target "${TARGET}" ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}
119119
fi

0 commit comments

Comments
 (0)