Skip to content

bundles: the .wo object embeds the checkout's absolute corpus path, so one key has a different object-sha per checkout #949

Closed

Description

@ehartford

What

The pcre2 bundle object written by with build lib/std/re/bundle.w --emit-obj --bundle-corpus std/re … carries the checkout's absolute path in its debug info:

$ strings out/wo/pcre2.o | grep -c with-staging/i946
2
/Users/eric/.local/with-staging/i946/lib/std/re

Consequences (observed 2026-09-03, three checkouts of the same corpus, same ABI stamp b5643494…, same key 9e7dec32…):

  • main tree store slot: object-sha 911055d3…
  • worktree i946 (branch wo-i946): object-sha 0727b97c…
  • worktree i946-base (main 9e86c3c): object-sha ba4630f8…

The .wi is path-free (interface-sha 99c2382a… in all three) and symbol names are canonical (<embedded-std>/std/re/…, D38 C0), so only DWARF differs. The key (corpus_sha | target | abi_sha) promises "same key, same object"; a slot published from one checkout and read by another will not be byte-identical, and the wo-drift lane's byte-identity check ("byte-identical to out/wo/pcre2.o") holds only within one checkout. A release-asset store (docs/wo_bundles.md, "each corpus version is also published as a release asset") makes this visible immediately.

Expected

A bundle build should not depend on where the tree is checked out: emit the canonical <embedded-std>/std/<corpus>/ spelling (or no absolute directory) as the DWARF compilation directory for bundle modules, the same identity the symbol mangling already uses.

Activity

  1. ehartford commented on Sep 3, 2026

    @ehartford
    ContributorAuthor

    Fixed on main: 92edfe7 — the DWARF compile unit names a stdlib-tree root by its canonical path (/std/re/bundle.w), so a .wo object is byte-identical from every checkout. Proof: the same stage1 building lib/std/re/bundle.w with --bundle-corpus std/re from /Users/eric/with and from a worktree gives byte-identical objects, zero absolute checkout paths, canonical directory in the DWARF. Battery green, pushed, reseeded.

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