Negative `input` pattern is ignored for files discovered via `readdir`
Maintainer antworten meist innerhalb von 1 Tag
@wan9chi arbeitet bereits daran.
Seit 03.7.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Summary
A negative input pattern ("!path") correctly excludes a file a task reads by direct path, but does not exclude a file the task discovers through a directory listing (readdir). When such a file is a build artifact that is absent on a fresh checkout, its removal invalidates the cache with Removed, so the cache never hits, even though a negative pattern for that exact path is present.
Reproduction
https://github.com/why-reproductions-are-required/vite-task-negative-input-pattern-readdir
pnpm install
./repro.sh
The repro defines two tasks that differ only in how they discover an excluded, generated artifact:
// BUG: artifact found via readdir("assets")
"readdir-case": {
command: "node -e \"fs.readdirSync('assets'); fs.writeFileSync('assets/generated.txt', ...)\"",
input: [{ auto: true }, "!assets/generated.txt"],
},
// CONTROL: artifact read by direct path
"direct-path-case": {
command: "node -e \"try { fs.readFileSync('direct.txt') } catch {}; fs.writeFileSync('direct.txt', ...)\"",
input: [{ auto: true }, "!direct.txt"],
},
Expected vs actual
Each task is run 3 times; run 3 removes the excluded artifact before running. Removing an excluded file should keep the cache valid.
| task | discovery | run 3 result |
|---|---|---|
direct-path-case |
readFileSync |
HIT (correct) |
readdir-case |
readdirSync |
MISS: InputChanged { Removed, "assets/generated.txt" } |
Only the discovery method differs.
Impact
Real builds routinely list a directory that also contains generated files. In a Vite + void app the build lists directories holding .void/queues.d.ts, .void/routes.d.ts, public/feed.xml, public/sitemap.xml, public/posts/, etc. On a fresh CI checkout those files do not exist yet, so the cache misses on every run even with a negative pattern for each of them. The only workaround I found is to abandon { auto: true } and enumerate every input explicitly.
Possibly related
crates/vite_task/src/session/execute/fingerprint.rs notes that negative-glob filtering for the post-run fspy fingerprint is "done upstream" and that paths already in globbed_inputs are skipped; PathRead { read_dir_entries: bool } distinguishes directory-listing reads. The negative filter appears not to reach entries surfaced by a directory listing.
Environment
vite-plus0.2.2 (bundles Vite Task)- Reproduced on macOS (darwin 25.x) and GitHub Actions
ubuntu-latest
- Vorherrschende Sprache
- Rust
- Sterne
- 473
- Forks
- 44
- Ø Merge
- 1 T. 1 Std.
- Gemergte PRs (30 T.)
- 63
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus voidzero-dev/vite-task
-
Windows: automatic filesystem tracking makes Git/MSYS sh.exe fail with MapViewOfFileEx error 487Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 18/100
voidzero-dev/vite-task#830 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
voidzero-dev/vite-task#822 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Let tools mark cache directories with CACHEDIR.TAGEvtl. vergeben @lifeiscontent hat das vor 9 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
voidzero-dev/vite-task#793 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Preview cache hits without running tasksEvtl. vergeben @lifeiscontent hat das vor 10 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
voidzero-dev/vite-task#791 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Built-in tool tasks miss the cache after the workspace movesEvtl. vergeben @lifeiscontent hat das vor 10 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 67/100
voidzero-dev/vite-task#790 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in voidzero-dev/vite-task
Ähnliche Issues
-
ai_p2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
ClickHouse/ClickHouse#125522 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter servedEvtl. vergeben @Mrun25 hat das heute übernommen. Offenbug llm translation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
BerriAI/litellm#46095 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug effort:low flow:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
jaroslawherod/micold-ai-ide#788 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Docs: refresh target-app-parity and file-format-parity against mainEvtl. vergeben @vangel76 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
storytold/photocraft#4417 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
bevyengine/dlss_wgpu#37 ·