Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Cached compound command can replay a later step after preceding vp exec rewrites its input

オープン
#364 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
node.js, rust

調査の方向性

まず、リンクされた repro をクローンし、vite.config.ts と scripts/generate.mjs、scripts/normalize.mjs を確認して、2 つの PowerShell 再現ケースを両方実行します。vp exec エントリポイントから複合コマンドのキャッシュ処理を追跡します。完了の条件は、先行するステップが入力を書き換えた後、後続の && ステップでキャッシュミスが発生し、最後の 2 つのチェックが両方とも成功することです。

索引モデルが issue の本文から書いたものです。

説明

Summary

A cached compound command can replay a later && step even after an earlier vp exec ... step rewrites the file that the later step reads.

This is not specific to vp fmt: the same behavior reproduces when the later step is a plain node command that reads and rewrites the generated file.

Repro repo: https://github.com/SegaraRai/vitetask-repro04

Environment

Observed with:

  • vite-plus: 0.1.19
  • package manager: pnpm@10.33.2
  • Node: 24.x
  • OS: Windows

The repro commands below use PowerShell syntax for setting environment variables.

Reproduction

Clone and install:

git clone https://github.com/SegaraRai/vitetask-repro04.git
cd vitetask-repro04
vp install

The repo defines these tasks in vite.config.ts:

tasks: {
  generate: {
    command: "vp exec node ./scripts/generate.mjs && vp fmt src/generated",
    cache: true,
    input: ["scripts/generate.mjs"],
  },
  "generate:normalize": {
    command: "vp exec node ./scripts/generate.mjs && node ./scripts/normalize.mjs",
    cache: true,
    input: ["scripts/generate.mjs", "scripts/normalize.mjs"],
  },
}

Case 1, with vp fmt as the second step:

vp cache clean
$env:REPRO_MESSAGE = "first"; vp run generate
$env:REPRO_MESSAGE = "second"; vp run generate
vp fmt src/generated --check

Case 2, with plain node as the second step:

vp cache clean
$env:REPRO_MESSAGE = "first"; vp run generate:normalize
$env:REPRO_MESSAGE = "second"; vp run generate:normalize
node ./scripts/check-normalized.mjs

There is also a convenience script if useful:

vp exec node ./scripts/repro.mjs
Observed behavior

On the second run, the first step executes uncached, rewrites src/generated/messages.ts, and the second step is replayed from cache.

Representative output for case 1:

$ vp exec node ./scripts/generate.mjs ⊘ cache disabled
$ vp fmt src/generated ◉ cache hit, replaying

Representative output for case 2:

$ vp exec node ./scripts/generate.mjs ⊘ cache disabled
$ node ./scripts/normalize.mjs ◉ cache hit, replaying

The final check then fails because the generated file contains fresh content from the first step but did not receive the second step's normalization/formatting.

Expected behavior

The second step should not be replayed when its previously tracked input file was modified by an earlier step in the same compound command. It should miss cache and run against the current file contents.

Notes
  • This does not appear to be specific to vp fmt; the plain node ./scripts/normalize.mjs variant reproduces the same behavior.
  • In local testing, replacing the first command with plain node ./scripts/generate.mjs did not reproduce the issue.
  • Including the changing value in the task's tracked env/input avoids this particular repro, but the concern here is intra-task filesystem changes between && items.
  • This does not seem to be about restoring output files from cache. The file is rewritten by the preceding uncached step in the current run; the problem is that the following step is still replayed even though its read input has just changed.

A possible direction is that cache validation for later && items may need to account for filesystem writes from earlier items in the same task, especially when the earlier item is an expanded/cache-disabled vp exec invocation.

主要言語
Rust
スター
466
フォーク
42
平均マージ
1日 20時間
マージ済み PR(30日)
21

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/vite-task のほかの issue

voidzero-dev/vite-task の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。