Skip to content

[Bug]: corrupt persistent-cache meta recovery panics #14859

Description

@hardfist

Reproduction

Repository: https://github.com/hardfist/rspack-persistent-cache-meta-recovery-repro

This is a Node-level repro using the public @rspack/core compiler API. It pins the latest published package at the time of filing, @rspack/core@2.1.4; it does not build or call Rspack's Rust crates.

Run:

pnpm install
pnpm repro

The script creates a real filesystem persistent cache, truncates the first value in meta/0.pack to one byte, recomputes that pack's integrity hash, and starts a fresh Rspack process against the cache.

On @rspack/core@2.1.4, the child aborts with:

should decode success

The parent reports BUG REPRODUCED and exits 0.

Expected behavior

A malformed persistent-cache entry should return a recovery error so the cache context can invalidate/reset the meta scope. It should not abort the process.

Environment

  • @rspack/core@2.1.4
  • Node.js 24.16.0
  • macOS arm64

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