Skip to content

test(ci): self-host — link reld with reld via ld64.lld on macos-arm64 (#43) - #44

Merged
zackees merged 2 commits into
mainfrom
macos-self-host
Aug 7, 2026
Merged

zackees merged 2 commits into
mainfrom
macos-self-host

Conversation

@zackees

@zackees zackees commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Implements #43. Closes #43. macOS parallel to the merged Windows self-host (#40).

What

Links reld itself with reld (self-host) through the Mach-O bridge on the macos-arm64 CI leg — extending self-host coverage (the strongest correctness signal, P2/#6) from the small rusqlite fixture to a large real Rust binary (reld, ~17MB) on both bridged platforms.

The new step sets CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=<reld> + -Clinker-flavor=ld64.lld (the proven BR-3 flavor), then cargo build -p reld --bin reld — the RUSTFLAGS change forces a relink of reld through the bridge (reld → ld64.lld) — and runs reld --version, asserting Reld + exit 0.

It uses reld rather than reld-link because on a macOS host reld routes to the Mach-O bridge (reld-link would route to COFF).

Testing

Review

Independent review: APPROVE — flavor env identical to the proven BR-3 step; RUSTFLAGS change forces a real relink through ld64.lld (no cached-skip); set -euo pipefail + var=$(cmd) + grep -q prevent any false-green; no env leakage; scope clean.

🤖 Generated with Claude Code

…rm64 leg (#43)

macOS parallel to the Windows self-host (#40), completing the strongest
correctness signal (P2/#6) on both bridged platforms. After the workspace build
produces target/debug/reld, point cargo's darwin linker at it with
-Clinker-flavor=ld64.lld (the proven BR-3 flavor) and `cargo build -p reld
--bin reld`. The RUSTFLAGS change invalidates reld's link fingerprint, forcing a
relink through the Mach-O bridge (reld -> ld64.lld). Then run the self-linked
`reld --version` and assert `Reld` + exit 0.

Uses `reld` (not `reld-link`): on a macOS host `reld` routes to the Mach-O
bridge, whereas `reld-link` would route to COFF. Other legs unchanged.

Closes #43

Co-Authored-By: Claude Fable 5 <[email protected]>
…e --version

The self-host link (reld -> ld64.lld) succeeds — that IS the proof. But the
post-build `reld --version` check failed: on a macOS host, reld is invoked as a
linker and bridges every invocation (including --version) to ld64.lld, so it
prints `LLD ...` and exits nonzero rather than reld's own version. Replace the
runtime check with `test -x` + `file | grep Mach-O` on the relinked binary,
which confirms a well-formed self-linked executable without triggering the bridge.

(Note: the reld-vs-linker `--version` asymmetry between the COFF and Mach-O
hosts is a real reld behavior worth a follow-up; it does not affect linking.)
@zackees
zackees merged commit 694f888 into main Aug 7, 2026
6 checks passed
@zackees
zackees deleted the macos-self-host branch August 7, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS self-host: link reld with reld (ld64.lld bridge) as a CI gate

1 participant