Skip to content

[BUG] install rewrites identical .apm-pin markers on every run (no-op install is not write-free) #4790

Closed

Description

Summary

Every apm install rewrites apm_modules/<pkg>/.apm-pin for every dependency, even when the marker's bytes are identical, so an install that changes nothing is not write-free. At tree-10 that is 10 needless writes per no-op install.

Root cause: install/cache_pin.py write_marker writes unconditionally.

Expected

Leave an identical marker untouched. Still rewrite a marker that is missing, different or a symlink.

Evidence

Found by the PERF no-op fast-path work (#4770): the fail-closed write recorder refused a no-op run because of these writes. Fix prototyped at 25f2b8e, with a unit cell.

Out of scope

Any change to the marker format or to pin verification.

Activity

  1. added
    bug
    performance
    on Nov 22, 2026
  2. danielmeppiel commented on Nov 22, 2026

    @danielmeppiel
    CollaboratorAuthor

    Decision: approve
    Area: project
    Scope: apm install leaves an .apm-pin marker untouched when its on-disk bytes already equal what install would write, so a no-op install writes nothing. A marker that is missing, has different bytes, or is a symlink is still rewritten as today. The marker format and what install records are unchanged.
    Done when: A test runs apm install twice on an unchanged project and asserts the second run does not rewrite any .apm-pin marker (same bytes and mtime); tests show a missing, a changed and a symlinked marker are still rewritten. They fail before the fix where expected and pass after it, a CHANGELOG line is added, and CI is green.
    Out of scope: Marker format changes; other no-op write paths; the no-op fast path (#4770).
    Review contact: Daniel Meppiel (@danielmeppiel)

  3. added
    status/accepted
    on Nov 22, 2026
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

    bugperformancestatus/accepted

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions