Skip to content

A release compiler image linked but not yet stamped refuses its own embedded bundles ("embedded bundle 'pcre2' was built for ABI … but this compiler is WITHABISHASTAMPv1XXXX") #1330

Closed

Description

@ehartford

Seen on the Windows box while verifying #1329: running out/probe-after.exe (a compiler image produced by with-stage1 build out/gen/main.w -O1 -o probe.exe, i.e. the link output before build.w's link-compiler stamps the .unstamped image) fails at startup with embedded bundle 'pcre2' was built for ABI <digest> but this compiler is WITHABISHASTAMPv1XXXX…. The bundles carry the real ABI digest while the image still carries the placeholder, so the compiler-as-user-program probe (the failure-diagnostics flow in selfhost-windows.yml and any local with build main.w) produces a binary that cannot run. Pre-existing and unrelated to #1147/#1267. Either the probe path must stamp (the stamping step belongs to the link, not to build.w's target), or the check must recognise the placeholder as "unstamped image" with a message that says so.

Activity

  1. ehartford commented on Oct 2, 2026

    @ehartford
    ContributorAuthor

    Reproduced on main 1688728 on both hosts and fixed on branch fix-1330 (tip 4a3b956, rebased on 30f89aa, gate green; not pushed).

    Repro (unstamped probe image = with-stage1 build out/gen/main.w -O1 -o probe):

    • darwin-aarch64: out/probe-main build re.w (uses std.regex) → error: embedded bundle 'pcre2' was built for ABI 9f50ed35… but this compiler is WITHABISHASTAMPv1XXXX…
    • windows-x86_64 (win10, W:\verify-1): identical error from out\probe-single.exe build W:/re.w.

    Root cause: src/compiler/Link.w link_stage_select_embedded_bundles compared the bundle's abi-sha with compiler_abi_sha() unconditionally, while Compilation.load_link_bundles already skipped the comparison for an unstamped image.

    Fix: one rule, AbiStamp.abi_identity_refuses_bundle(self_abi, bundle_abi) — a stamped identity refuses another ABI (#761), an unstamped image links its bundles unchecked, as a hand-linked compiler keeps no generation (#1815); both link paths read it. test/internals/link_embedded_bundle_abi_test.w pins the three cases (red under the old rule, green with the fix).

    Verified: with the fix, the unstamped probe prints WITHABISHASTAMPv1XXXX… for version --abi-sha and links the std.regex program, which prints match — on darwin-aarch64 (out/probe-fix) and on win10 (W:\verify-2, patch applied on 30f89aa, src\main build green, out\probe-fix.exe).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions