--filter <pkg> add drops foreign-platform optional deps from pnpm lockfiles while plain install keeps them (1.34.0)
#1155
|
On a pnpm workspace whose Both commands are aube
On Why it is easy to miss
$ pnpm install --frozen-lockfile --ignore-scripts \
--config.supportedArchitectures.os=darwin \
--config.supportedArchitectures.cpu=arm64
Done in 126ms
$ ls node_modules/.pnpm | grep esbuild
esbuild@0.25.12
@esbuild+linux-x64@0.25.12 # no darwin binaryReprohttps://github.com/mwolson/tmp-aube-issues/tree/main/pnpm-filter-add-prunes-platform-optionals
AUBE_BIN=aube PNPM_BIN=/path/to/real/pnpm ./repro.shThe workspace is one package depending on supportedArchitectures:
cpu: [current, x64]
libc: [current, glibc]
os: [current, linux]Relationship to #938#938 reported this class of problem for
Versions
Not testedWhether an explicit |
Replies: 2 comments
|
Thanks for the detailed repro. I confirmed the root cause: the shared resolver narrowed portable-lockfile resolution whenever PR #1156 fixes this by keeping portable lockfile resolution in This comment was generated by Codex. |
|
Confirmed fixed on aube Retested the minimal repro at https://github.com/mwolson/tmp-aube-issues/tree/main/pnpm-filter-add-prunes-platform-optionals: Marking the fix reply as the answer; leaving the discussion open for searchability. |
Thanks for the detailed repro. I confirmed the root cause: the shared resolver narrowed portable-lockfile resolution whenever
supportedArchitectureswas configured, so any re-resolution path could discard optional packages for other platforms. Plaininstalloften hid it by taking the fresh-lockfile path without rewriting the lockfile.PR #1156 fixes this by keeping portable lockfile resolution in
accept_allmode while continuing to applysupportedArchitecturesduring fetch/link filtering. With the supplied esbuild repro, the filteredaddnow retains all 45 foreign-platform entries; the lockfile diff contains onlyis-oddand its dependency.#1156
This comment was generated by Codex.