Skip to content

Commit 71153f1

Browse files
committed
Test a few tier 3 targets
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
1 parent 833eb19 commit 71153f1

File tree

3 files changed

+81
-10
lines changed

3 files changed

+81
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,65 @@ 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+
- name: Add matrix env variables to the environment
319+
if: matrix.env
320+
run: |
321+
echo '${{ toJson(matrix.env) }}' |
322+
jq -r 'to_entries | map("\(.key)=\(.value|tostring)") | .[]' >>$GITHUB_ENV
323+
shell: bash
324+
325+
- name: Execute run-docker.sh
326+
run: ./ci/run-docker.sh ${{ matrix.target }}
327+
328+
- name: Create CI artifacts
329+
id: create_artifacts
330+
if: always()
331+
run: ./ci/create-artifacts.py
332+
- uses: actions/upload-artifact@v4
333+
if: always() && steps.create_artifacts.outcome == 'success'
334+
with:
335+
name: ${{ env.ARCHIVE_NAME }}-${{ matrix.target }}${{ matrix.artifact-tag && format('-{0}', matrix.artifact-tag) }}
336+
path: ${{ env.ARCHIVE_PATH }}
337+
retention-days: 5
338+
280339
test_tier2_vm:
281340
name: Test tier2 VM
282341
needs: [test_tier1, style_check]
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
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
6+
7+
# Set up an Alpine sysroot for acquiring libgcc and libgcc_s
8+
RUN curl https://repo.chimera-linux.org/apk/3.0.0_rc4-r2/apk-x86_64.static -o /usr/bin/apk && \
9+
chmod +x /usr/bin/apk && \
10+
mkdir /alpine-sysroot && \
11+
apk \
12+
--arch s390x \
13+
--root /alpine-sysroot \
14+
--repository https://dl-cdn.alpinelinux.org/alpine/v3.22/main \
15+
add \
16+
--initdb \
17+
--allow-untrusted \
18+
alpine-baselayout libgcc
919

1020
COPY install-musl.sh /
1121
RUN /install-musl.sh s390x
1222

1323
# 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 \
17-
RUSTFLAGS='-Clink-args=-lgcc -L /musl-s390x/lib' \
18-
PATH=$PATH:/musl-s390x/bin:/rust/bin
24+
ENV PATH=$PATH:/musl-s390x/bin:/rust/bin \
25+
CC_s390x_unknown_linux_musl=musl-gcc \
26+
RUSTFLAGS='-Clink-args=-lgcc -L/alpine-sysroot/usr/lib -L /musl-s390x/lib' \
27+
CARGO_TARGET_S390X_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
28+
CARGO_TARGET_S390X_UNKNOWN_LINUX_MUSL_RUNNER="qemu-s390x -L /musl-s390x"

ctest/src/macro_expansion.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ pub fn expand<P: AsRef<Path>>(
1212
target: String,
1313
) -> Result<String> {
1414
let rustc = env::var("RUSTC").unwrap_or_else(|_| String::from("rustc"));
15+
let out_dir = env::var("OUT_DIR").unwrap();
1516

1617
let mut cmd = Command::new(rustc);
1718
cmd.env("RUSTC_BOOTSTRAP", "1")
1819
.arg("-Zunpretty=expanded")
20+
.arg(format!("-L{out_dir}/../../../deps"))
1921
.arg("--edition")
2022
.arg(EDITION) // By default, -Zunpretty=expanded uses 2015 edition.
2123
.arg(canonicalize(crate_path)?);

0 commit comments

Comments
 (0)