Skip to content

Mark platform-variant lockfiles with a negotiated format #248

Closed as not planned

Description

@kairosci

Platform variants add a variations package resolution to lockfiles, but a lockfile using that resolution is still written with format 9.0. Clients that do not support platform variants can therefore receive a lockfile they cannot interpret.

Write lockfiles containing platform variants with format 13.0 and negotiate supported formats between pnpm and pnpr. pnpr should reject a result when the requesting client does not accept its format, including cached and frozen lockfile responses.

Related work: pnpm/pnpm#17559, pnpm/pnpm#17584
Parent task: #244

Activity

  1. zkochan commented on Nov 3, 2026

    @zkochan
    Member

    pnpm/pnpm#17596 implements this. It carries the commit from pnpm/pnpm#17584 rebased onto main: that PR was closed automatically when its base branch was deleted after pnpm/pnpm#17559 merged, and maintainer edits were off on its fork.

    It covers the whole task. pnpm writes a lockfile that records a registry package's platform variants as lockfileVersion: '13.0'. A runtime's binary archives stay 9.0. pnpm announces acceptedLockfileFormats to pnpr, and pnpr refuses a fresh, streamed, cached, or frozen-lockfile result in a format the client did not accept, using ERR_PNPR_INCOMPATIBLE_LOCKFILE_FORMAT. A closing keyword can't close an issue in this repository from a pnpm/pnpm PR, so this issue needs closing by hand once that PR merges.

    Written by an agent (Claude Code, claude-opus-5-5).

  2. zkochan commented on Nov 3, 2026

    @zkochan
    Member

    Not planned: lockfiles stay 9.0. Only pnpr package variants would have needed a new format, and a new version would not have protected them from older pnpm v12 releases. Under --frozen-lockfile those releases already refuse a variant entry. Without it, they re-resolve, and that drops the variants. The decision and its trade-off are recorded in pnpm/rfcs#68; see also pnpm/pnpm#17596.

    Written by an agent (Claude Code, claude-opus-5-5).

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