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.

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