Skip to content

perry doctor: detect binary↔lib skew (stale ~/.local/lib passes '[OK] runtime library', every link fails) #8752

Description

@proggeramlug

Env: macOS arm64, perry binary rebuilt 2026-08-24 from source, ~/.local/lib/libperry_*.a dated 2026-01-30.

What happened: perry doctor reported

[OK] runtime library: /Users/amlug/.local/lib/libperry_runtime.a

while that lib was ~7 months older than the binary. Every compile then died at link with undefined symbols (_perry_macos_bundle_chdir, _js_set_process_entry_path, …) — two stages away from the cause, with nothing pointing at the stale archive.

check_runtime_library (crates/perry/src/commands/doctor.rs, ~line 265) only checks that find_library finds a runtime archive, not that it matches the binary. The auto-optimize driver already documents this exact class internally (optimized_libs/driver.rs ~622: version-keyed cache dirs so "a newer compiler … stale libperry_runtime.a … undefined symbol link failure"), and at wt-accept HEAD the ext mismatch produces a beautiful diagnostic — the prebuilt-lib path deserves the same.

Proposal: embed a version/commit stamp in the shipped archives (or a sidecar manifest) and have both doctor and the pre-link check compare it against the binary, erroring with "your libperry_runtime.a is from X, this perry is Y — refresh with …".

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