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.

Fetch-failure swallow for optional snapshots + ResolutionFailure payload (#434 slice 4) #471

@zkochan

Description

@zkochan

Follow-up to #434 (umbrella, closed). Slices 1–3 (#439, #456, #467) handle installability-driven skips end to end. This slice closes a different swallow path: an optional: true snapshot whose tarball / metadata / extract step fails at install time must not abort the install. The non-optional case still aborts.

Scope

Mirror pnpm/pnpm@94240bc046's two frozen-path catch sites:

Both sites are silent — no pnpm:skipped-optional-dependency event is emitted at fetch time on the frozen path. The corresponding upstream test at deps-restorer/test/index.ts:340-360 only asserts that the install completes and the other deps land — it never inspects the reporter mock.

For pacquet the equivalent surface is InstallPackageBySnapshot::run inside CreateVirtualStore. Today every fetch / extract error there propagates unconditionally as CreateVirtualStoreError::InstallPackageBySnapshot(...). This slice:

  • Wraps the per-snapshot fetch / extract dispatch so an optional: true snapshot's TarballError / WriteCasFileError / similar is silently dropped (no virtual-store slot created, no symlink, install continues).
  • Non-optional failures still surface unchanged.
  • The skip set is not updated for fetch failures — matches upstream behavior at the graph-builder site (only installability failures land in opts.skipped at :213).

ResolutionFailure sibling payload

The doc comment at crates/reporter/src/lib.rs:546-562 already flags that resolution_failure carries a different payload shape ({ name?, version?, bareSpecifier }) than the other three reasons ({ id, name, version }). Upstream defines the discriminated union explicitly at core-loggers/src/skippedOptionalDependencyLogger.ts:10-31.

Land the variant now — either via a sibling SkippedOptionalDependencyLog enum or #[serde(untagged)] on SkippedOptionalPackage. The actual emit site is resolver-only (resolveDependencies.ts:1376-1383) and pacquet has no resolver yet, so the variant is wire-shape-only in slice 4. Slice 7 (ignoredOptionalDependencies) and any future resolver-side work consume it.

Tests to port

Out of scope

Upstream pin

pnpm/pnpm@94240bc046. Pacquet umbrella slice 1 in #439, slice 2 in #456, slice 3 in #467; this is umbrella slice 4.


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