1- name : ci- cross
1+ name : cross-build-test
22
3- # mcpp cross-build matrix — the single source of truth for "which cross -build
3+ # mcpp cross-build test — the single source of truth for "which CROSS -build
44# target combinations mcpp supports", verified end-to-end.
55#
6- # Verification targets are mcpp ITSELF and xlings (both real, self-hosting C++23
7- # module projects), cross-built from source for each target triple. The produced
8- # binaries are arch-checked and smoke-run (natively when the target arch == host,
9- # under qemu-user otherwise).
6+ # Cross = host arch ≠ target arch. Verification targets are mcpp ITSELF and
7+ # xlings (real, self-hosting C++23 module projects), cross-built from source for
8+ # each target triple, arch-checked, and smoke-run under qemu-user.
109#
11- # ── Supported matrix (built + verified below) ──────────────────────────────
12- # target | toolchain | host→target | run
13- # ----------------------|---------------------------------|--------------|------
14- # x86_64-linux-musl | gcc@15.1.0-musl (native musl) | x86_64→x86_64| native
15- # aarch64-linux-musl | aarch64-linux-musl-gcc@15.1.0 | x86_64→arm64 | qemu
10+ # ── Supported cross matrix (built + verified below) ────────────────────────
11+ # target | toolchain | host→target | run
12+ # ----------------------|---------------------------------|---------------|-----
13+ # aarch64-linux-musl | aarch64-linux-musl-gcc@15.1.0 | x86_64→arm64 | qemu
1614#
17- # mcpp resolves a `--target <triple>-musl` build to the matching gcc musl
18- # toolchain from the xlings ecosystem (src/build/prepare.cppm): host==target →
19- # the native `gcc@15.1.0-musl`; host!=target → the triple-named cross toolchain
20- # `<triple>-gcc@15.1.0` (e.g. xim:aarch64-linux-musl-gcc). Output is a fully
21- # static musl ELF (no PT_INTERP), which also makes the aarch64 artefact runnable
22- # natively in Termux/Android — qemu-aarch64 is the CI proxy for "does it execute".
15+ # mcpp resolves a cross `--target <triple>-musl` build to the triple-named cross
16+ # gcc musl toolchain from the xlings ecosystem (xim:<triple>-gcc, see
17+ # src/build/prepare.cppm). Output is a fully static musl ELF (no PT_INTERP),
18+ # which also makes the aarch64 artefact runnable natively in Termux/Android —
19+ # qemu-aarch64 is the CI proxy for "does this cross artefact actually execute".
2320#
24- # ── Planned (NOT yet wired in mcpp — do not add as live jobs until implemented) ─
21+ # ── NOT here ───────────────────────────────────────────────────────────────
22+ # * Same-arch builds (host arch == target arch) are NOT cross. The native musl
23+ # static build `--target x86_64-linux-musl` (x86_64 host) is exercised by
24+ # ci-linux.yml's "Toolchain: musl-gcc" step, and release.yml for the static
25+ # release artefact. Keep them there; this file is cross-arch only.
26+ #
27+ # ── Planned cross rows (documented; NOT yet wired in mcpp — keep as comments) ─
2528# * llvm/clang cross : clang is inherently a cross-compiler, but mcpp does not
2629# yet inject `-target <triple>` + a cross sysroot for a
27- # clang toolchain; `--target` currently resolves to gcc
28- # musl only. Wire the clang cross path first, then add a
29- # `llvm@20.1.7` row here.
30- # * more triples : e.g. riscv64-linux-musl, once the cross toolchain asset
31- # is published to xlings-res + xim-pkgindex.
30+ # clang toolchain; cross `--target` resolves to gcc musl
31+ # only. Wire the clang cross path first, then add a row.
32+ # * riscv64-linux-musl: add once xim:riscv64-linux-musl-gcc ships to
33+ # xlings-res + xim-pkgindex.
3234
3335on :
3436 push :
5052 fail-fast : false
5153 matrix :
5254 include :
53- - target : x86_64-linux-musl
54- file_arch : " x86-64"
55- qemu : false
5655 - target : aarch64-linux-musl
5756 file_arch : " ARM aarch64"
58- qemu : true
57+ qemu_bin : qemu-aarch64-static
5958 env :
6059 MCPP_HOME : /home/runner/.mcpp
6160 steps :
@@ -78,11 +77,10 @@ jobs:
7877 xlings-${{ runner.os }}-v2-
7978
8079 - name : Install qemu-user-static
81- if : matrix.qemu
8280 run : |
8381 sudo apt-get update -qq
8482 sudo apt-get install -y qemu-user-static
85- qemu-aarch64-static --version | head -1
83+ ${{ matrix.qemu_bin }} --version | head -1
8684
8785 - name : Bootstrap mcpp via xlings
8886 env :
@@ -140,10 +138,9 @@ jobs:
140138 file "$xbin" | grep -q "statically linked" || { echo "expected static"; exit 1; }
141139 echo "XLINGS_XBIN=$xbin" >> "$GITHUB_ENV"
142140
143- - name : " Smoke-run cross artefacts (${{ matrix. qemu && 'qemu' || 'native' }}) "
141+ - name : " Smoke-run cross artefacts under qemu"
144142 run : |
145- RUN=""
146- if [ "${{ matrix.qemu }}" = "true" ]; then RUN="qemu-aarch64-static"; fi
143+ RUN="${{ matrix.qemu_bin }}"
147144 echo "== mcpp --version =="
148145 mver=$($RUN "$MCPP_XBIN" --version)
149146 echo "$mver"; echo "$mver" | grep -q "mcpp" || { echo "mcpp --version failed"; exit 1; }
0 commit comments