Skip to content

Commit 6ac8c76

Browse files
committed
Test a few tier 3 targets
Signed-off-by: Jens Reidel <[email protected]>
1 parent 833eb19 commit 6ac8c76

File tree

4 files changed

+78
-12
lines changed

4 files changed

+78
-12
lines changed

.github/workflows/ci.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,69 @@ jobs:
277277
path: ${{ env.ARCHIVE_PATH }}
278278
retention-days: 5
279279

280+
test_tier3:
281+
name: Test tier3
282+
needs: [test_tier2, style_check]
283+
runs-on: ubuntu-24.04
284+
strategy:
285+
fail-fast: true
286+
max-parallel: 12
287+
matrix:
288+
target:
289+
# We test a handful of tier 3 targets that are known to be well-maintained
290+
#- mips64-unknown-linux-muslabi64
291+
#- powerpc64-unknown-linux-musl
292+
#- riscv64gc-unknown-linux-musl
293+
- s390x-unknown-linux-musl
294+
include:
295+
#- target: mips64-unknown-linux-muslabi64
296+
# env:
297+
# RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1
298+
#- target: powerpc64-unknown-linux-musl
299+
# env:
300+
# RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1
301+
#- target: riscv64gc-unknown-linux-musl
302+
# env:
303+
# RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1
304+
- target: s390x-unknown-linux-musl
305+
env:
306+
RUST_LIBC_UNSTABLE_MUSL_V1_2_3: 1
307+
timeout-minutes: 25
308+
env:
309+
TARGET: ${{ matrix.target }}
310+
LIBC_XARGO: 1
311+
steps:
312+
- uses: actions/checkout@v5
313+
- name: Setup Rust toolchain
314+
run: ./ci/install-rust.sh
315+
- uses: Swatinem/rust-cache@v2
316+
with:
317+
key: ${{ matrix.target }}
318+
# Since we invoke rustc directly, we cannot use -Zbuild-std
319+
# and instead rely on xargo to create the sysroot
320+
- name: Install xargo
321+
run: cargo install --git https://github.com/svenpaulsen/xargo
322+
- name: Add matrix env variables to the environment
323+
if: matrix.env
324+
run: |
325+
echo '${{ toJson(matrix.env) }}' |
326+
jq -r 'to_entries | map("\(.key)=\(.value|tostring)") | .[]' >>$GITHUB_ENV
327+
shell: bash
328+
329+
- name: Execute run-docker.sh
330+
run: ./ci/run-docker.sh ${{ matrix.target }}
331+
332+
- name: Create CI artifacts
333+
id: create_artifacts
334+
if: always()
335+
run: ./ci/create-artifacts.py
336+
- uses: actions/upload-artifact@v4
337+
if: always() && steps.create_artifacts.outcome == 'success'
338+
with:
339+
name: ${{ env.ARCHIVE_NAME }}-${{ matrix.target }}${{ matrix.artifact-tag && format('-{0}', matrix.artifact-tag) }}
340+
path: ${{ env.ARCHIVE_PATH }}
341+
retention-days: 5
342+
280343
test_tier2_vm:
281344
name: Test tier2 VM
282345
needs: [test_tier1, style_check]
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
FROM ubuntu:25.04
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
4-
curl ca-certificates \
5-
gcc \
6-
gcc-s390x-linux-gnu \
7-
qemu-user \
8-
xz-utils patch rsync
4+
gcc make libc6-dev git curl ca-certificates \
5+
gcc-s390x-linux-gnu qemu-user xz-utils patch rsync
96

107
COPY install-musl.sh /
118
RUN /install-musl.sh s390x
129

1310
# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in std?
14-
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
15-
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /musl-s390x" \
16-
CC_s390x_unknown_linux_gnu=musl-gcc \
11+
ENV PATH=$PATH:/musl-s390x/bin:/rust/bin \
12+
CC_s390x_unknown_linux_musl=musl-gcc \
1713
RUSTFLAGS='-Clink-args=-lgcc -L /musl-s390x/lib' \
18-
PATH=$PATH:/musl-s390x/bin:/rust/bin
14+
CARGO_TARGET_S390X_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
15+
CARGO_TARGET_S390X_UNKNOWN_LINUX_MUSL_RUNNER="qemu-s390x -L /musl-s390x"

ci/run-docker.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ run() {
4343
--user "$(id -u)":"$(id -g)" \
4444
--env LIBC_CI \
4545
--env LIBC_CI_ZBUILD_STD \
46+
--env LIBC_XARGO=${LIBC_XARGO:-0} \
4647
--env RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS \
4748
--env RUST_LIBC_UNSTABLE_GNU_TIME_BITS \
4849
--env CARGO_HOME=/cargo \
@@ -55,7 +56,7 @@ run() {
5556
--init \
5657
--workdir /checkout \
5758
"libc-$target" \
58-
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec ci/run.sh $target"
59+
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin:/cargo/bin exec ci/run.sh $target"
5960
}
6061

6162
if [ -z "$target" ]; then

ci/run.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ set -eux
77

88
target="$1"
99

10-
export RUST_BACKTRACE="${RUST_BACKTRACE:-1}"
10+
if [ "${LIBC_XARGO:-0}" -eq "1" ]; then
11+
cargo="xargo"
12+
else
13+
cargo="cargo"
14+
fi
1115

12-
cmd="cargo test --target $target ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}"
16+
export RUST_BACKTRACE="${RUST_BACKTRACE:-1}"
17+
cmd="$cargo test --target $target ${LIBC_CI_ZBUILD_STD+"-Zbuild-std"}"
1318
test_flags="--skip check_style"
1419

1520
# Run tests in the `libc` crate

0 commit comments

Comments
 (0)