Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

A cache hit whose outputs can't be restored exits 0 and is reported as a hit

未关闭
#767 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
build-system, cli

调研方向

Reproduce the failure with vp run build after deleting the task archive under node_modules/.vite/task-cache/, then inspect the cache-hit restoration and task-summary paths used by vp run --last-details. Done means a failed restore produces a non-zero exit, is shown as a task failure rather than a cache hit, and does not leave the broken cache entry for later runs.

由索引模型根据 Issue 内容生成。

描述

remote cache

When vp run gets a cache hit but can't restore the task's output files, for example because the cached archive was deleted or is corrupt, it prints an error, but:

  • the run exits with code 0, so CI passes without the task's outputs;
  • the summary line still says cache hit;
  • vp run --last-details shows the task with ✓ as a cache hit, without the error.

The broken entry also stays in the cache, so every later run hits it and fails the same way until vp cache clean.

Remote caching makes this easier to reach. An entry from the remote cache is saved locally before its outputs are restored, so an archive that downloads but can't be restored leaves the same broken entry behind (#756).

Steps to reproduce

  1. Run a cached task that has output files, such as vp run build.
  2. Delete its .tar.zst archive under node_modules/.vite/task-cache/.
  3. Run vp run build again and check the exit code, then run vp run --last-details.
$ … ◉ cache hit, replaying
✗ Cache lookup failed: failed to restore cached outputs from …/node_modules/.vite/task-cache/v18/….tar.zst; the archive may have been deleted or corrupted. Run `vp cache clean` to clear the cache.: No such file or directory (os error 2)

---
vp run: cache hit, 94ms saved.

The exit code is 0, and --last-details shows:

Statistics:   1 tasks • 1 cache hits • 0 cache misses
...
  [1] my-package#build: $ … ✓
      → Cache hit - output replayed - 94ms saved

Expected: the run fails with a non-zero exit code, the summary reports the task as failed with its error, and later runs don't keep hitting the broken entry.

主要语言
Rust
星标
468
派生
42
平均合并
1 天 10 小时
30 天内合并 PR
43

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

voidzero-dev/vite-task 的其他 Issue

查看 voidzero-dev/vite-task 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。