Skip to content

An unstamped compiler image links its own embedded bundles: one owner for the ABI-stamp refusal (#1330) - #1956

Merged
ehartford merged 1 commit into
fix-1955from
fix-1330
Oct 2, 2026
Merged

ehartford merged 1 commit into
fix-1955from
fix-1330

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Fixes #1330. Link.w compared the bundle ABI to the compiler's stamp unconditionally while Compilation.load_link_bundles already exempted an unstamped (WITHABISHASTAMPv1XXXX…) image; now AbiStamp.abi_identity_refuses_bundle owns the rule and both paths read it. test/internals/link_embedded_bundle_abi_test.w red before, green after; the probe image links std.regex and runs on Mac and win10. Gate green on 30f89aa. Battery with the next batch.

@ehartford
ehartford changed the base branch from main to fix-1955 October 2, 2026 18:52
@ehartford
ehartford added this pull request to stack #1969 October 2, 2026 18:53
…d, as it links an explicit --link-bundle (#1330)

A compiler linked as a program (`with-stage1 build out/gen/main.w`, the
failure-diagnostics probe) carries the ABI slot's placeholder while the
bundles it embeds carry the tree's digest. Link.link_stage_select_embedded_bundles
compared the two and refused every link that needed a bundle:

    $ out/probe-main build re.w        # use std.regex
    error: embedded bundle 'pcre2' was built for ABI 9f50ed35… but this
    compiler is WITHABISHASTAMPv1XXXX… (a .wo never links across ABI
    identities; rebuild the bundle)

Compilation.load_link_bundles already skipped the comparison for an
unstamped image, and a hand-linked compiler keeps no generation (#1815):
an image with no identity has nothing to compare, and the bundles it
embeds are the ones the link that produced it was given. The rule now has
one owner, AbiStamp.abi_identity_refuses_bundle, read by both link paths;
a stamped identity still refuses another ABI (#761).

test/internals/link_embedded_bundle_abi_test.w pins the three cases; it
fails under the old rule (the test binary is itself unstamped) and passes
with this one. Reproduced and verified on darwin-aarch64 main 1688728 with
a stage1-built probe image: before, the error above; after, the std.regex
program links and prints "match".
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on stack top 7bdd704 (seed-driven, with run tools/battery.w, stack #1972 = #1966 → #1956 → #1961 → #1968 → #1959 → #1971 → #1970, on main 30f89aa): gate rc=0 wall=489s, battery-checks rc=0 wall=379s — fixpoint, drop and move audits, every corpus. Earlier reds on this stack were (a) #1239/#1955 fallout in fixtures the sweeps did not compile, fixed in-layer and in #1970, and (b) a stage2≠stage3 'self-miscompile' that turned out to be cross-worktree contamination through a shared out/gen symlink, root-caused with lldb and guarded in #1971; the bisect-reverted commit was innocent and is restored. Run from a worktree with its own out/gen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant