On this page

Linux-musl distribution smoke

This M15.1 slice checks two Linux artifacts independently. The compiler artifact is the Rust tenon CLI. The generated artifact is a hello program (historically tests/programs/hello/main.tn in the M15.1 tree), compiled through the host Tenon CLI and Zig's musl C toolchain. Each smoke compares stdout byte for byte with the expected output and requires exit 0.

Preflight and build

Run from the repository root. Use aarch64 or x86_64 and choose fresh output directories with an existing parent. The script accepts GNU readelf or LLVM llvm-readelf on PATH. Set READELF to an absolute executable path if needed. The commands use existing tools and caches. The Cargo build is locked and offline, so its dependencies must already be cached. Zig uses private caches in the generated build directory.

arch=aarch64
dist=$(mktemp -d)
bash scripts/dist/linux-musl.sh preflight "$arch"

Preflight reports the Rust target library and bundled linker, Zig, the ELF reader and whether the current host is a matching Linux runner. Missing build prerequisites give exit 1. A cross-build host can pass preflight and still require a separate Linux runner. Use the available build path independently if the other path is blocked.

# Build the Rust compiler with the pinned musl std and bundled rust-lld.
bash scripts/dist/linux-musl.sh compiler "$arch" "$dist/compiler"

# Build the generated program with an existing host Tenon from this checkout.
# If needed, build that host binary with the repository's pinned toolchain.
cargo build --locked --offline -p tenon --bin tenon
bash scripts/dist/linux-musl.sh generated "$arch" "$dist/generated" target/debug/tenon

Builds produce $dist/compiler/tenon and $dist/generated/hello, respectively. Each checks for a little-endian ELF64 executable of the requested architecture with no PT_INTERP segment and no DT_NEEDED entries. This also accepts a static PIE. verify ARCH BINARY performs the same check on a copied artifact. The ELF checks establish architecture and linkage. The Rust and Zig target arguments establish the selected libc.

The Rust build uses the target's self-contained startup objects and libraries with the linker shipped by the pinned toolchain. The generated build sets CC to zig cc -target <arch>-linux-musl -static and disables Tenon's native build cache. These paths follow the existing C backend contract and the Rust toolchain pin. See the Rust linkage reference and Zig cross-compilation overview.

Run on Linux

On a matching Linux host, use a checkout with the smoke script and fixture. Copy the available binaries there, preserving execute permission, then run the applicable commands with their Linux-side paths. The compiler runs the hello fixture through interp, so this step needs no C toolchain. The generated binary runs directly.

bash scripts/dist/linux-musl.sh smoke "$arch" compiler "$dist/compiler/tenon"
bash scripts/dist/linux-musl.sh smoke "$arch" generated "$dist/generated/hello"

Run bash scripts/dist/test-linux-musl.sh "$arch" to exercise the verifier with tiny Zig-linked static and dynamic ELF fixtures. On a matching Linux host the test also checks that the smoke accepts the golden output and rejects a wrong stdout or exit status.

The qualification covers the CLI and a no-FFI generated program. FFI, toolchain bundling, macOS and Windows packaging, and checkpoint CP-15.1 are separate work.

See the lane evidence for the checks run on the initial candidate.