Skip to content

codegen: cwd hash baked into __perry_cap_* symbols defeats reproducible builds and every cross-directory A/B (#7038/#7131/#7172 family) #7177

Description

@proggeramlug

Found while building PR #7176's byte-neutrality harness: Perry bakes a hash of the current working directory into __perry_cap_* symbol names, so the same source compiled from two different directories produces different IR/objects.

Measured: with per-run mkdtemp working directories, 29 of 29 same-compiler control runs failed (same compiler, same source, different cwd → different symbols). The harness had to pin a fixed working directory to make any comparison valid.

Why it matters

Fix shape

Key __perry_cap_* on something checkout-invariant — e.g. the module's repo-relative path or a content hash of the source — rather than the absolute cwd. (If the cwd hash exists to disambiguate concurrent builds of different projects, a project-root-relative identity preserves that without breaking reproducibility.)

Acceptance

Same source, same compiler, two different working directories → byte-identical objects (the exact control #7176's harness runs). Red today on all 29 census workloads probed.

Activity

  1. proggeramlug commented on Aug 11, 2026

    @proggeramlug
    ContributorAuthor

    Verified fixed on current origin/main at ed97b9c by merged PR #7806 (merge commit b7e1346). Production HIR lowering now derives the class-capture salt from the stable module name rather than the canonical absolute source path; the merged parity probe also covers distinct same-basename modules and same-module inheritance. Closing as fixed by #7806.

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