Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.
This repository was archived by the owner on May 14, 2026. It is now read-only.

supportedArchitectures config + --cpu/--os/--libc CLI flags + real libc detection (#434 slice 2) #453

@zkochan

Description

@zkochan

Follow-up to #434 (umbrella, closed) and #439 (slice 1, merged). Pacquet now skips installability-incompatible optional dependencies, but the only SupportedArchitectures value it ever sees is None — so every install behaves as if the user opted into "every variant for the host triple only". This blocks two real workflows pnpm supports:

  1. Cross-architecture installpnpm install --cpu=arm64 --os=darwin on an x64 Linux host materializes the macOS arm64 variants in node_modules. Useful for prebuilt binary packages (esbuild, swc, native add-ons) when running CI for a host arch you don't have.

  2. Multi-arch dev artifactspnpm-workspace.yaml carries supportedArchitectures: { os: ['darwin', 'linux'], cpu: ['arm64', 'x64'] }, materializing every variant the team's devs use so a single pnpm install covers everyone.

Scope

Mirror upstream's three wiring points pinned at pnpm/pnpm@94240bc046:

Real libc detection

Slice 1 stubbed host_libc() to always return "unknown" so libc checks no-op on every host (matches non-Linux behavior). This slice replaces it with a real probe — detect-libc Rust crate, or an open-coded ldd --version parse with a /lib*/libc.so* fallback — so musl / glibc constraints actually filter on Linux. "unknown" fallback remains for hosts where detection genuinely fails.

Tests to port

  • optionalDependencies.ts:594install optional dependency for the supported architecture set by the user (nodeLinker=%s); covers config + frozen-reinstall.
  • optionalDependencies.ts:618 / :633 / :648remove optional dependencies that are not used and variants. Depend on the current-lockfile path; partial ports as known_failures until slice 6 lands.

Out of scope

  • The removeOptionalDependenciesThatAreNotUsed behavior end-to-end depends on the current lockfile (slice 6 of the umbrella); this slice only sets up the config + check input.
  • .modules.yaml.skipped write/read is umbrella slice 3.
  • --no-optional plumbing is umbrella slice 5.

Upstream

pnpm/pnpm@94240bc046. Pacquet slice 1 landed in #439; this is umbrella slice 2.


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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions