voidzero-dev / voidzero-dev/vite-task

Windows fspy reports the workspace root as a read-write overlap and prevents caching

Offen
#548 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Rust
Sterne
466
Forks
42
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
19

Beschreibung

Summary

A cached task using the default automatic input and output inference completes successfully on Windows, but Vite Task refuses to store the cache entry because fspy reports the workspace root as both read and written.

The same fixture completes without this cache diagnostic on Linux and macOS.

Reproduction

This was captured by a real cross-platform Vite+ snapshot test added while working on voidzero-dev/vite-plus#2151.

The fixture used a real managed Bun 1.3.14 installation rather than a mocked executable. Its configured task was equivalent to:

export default {
  run: {
    tasks: {
      'gate:test': {
        command: 'bun probe',
      },
    },
  },
}

The package script executed a real package binary through Bun:

{
  "scripts": {
    "probe": "bunx --bun probe"
  },
  "dependencies": {
    "probe-bin": "file:./probe-bin"
  },
  "devEngines": {
    "packageManager": {
      "name": "bun",
      "version": "1.3.14",
      "onFail": "download"
    }
  }
}

The snapshot steps were:

vp install
vp run gate:test
vp run --last-details

The command itself succeeded:

$ bun probe
$ bunx --bun probe
probe binary ran

Only the Windows run then reported:

vp run: vite-task-bunx-wrapper#gate:test not cached because it modified its input.

[1] vite-task-bunx-wrapper#gate:test: $ bun probe ✓
    → Not cached: read and wrote ''

The empty relative path is the workspace root. Re-running the task cannot hit the cache because no entry was stored.

Expected behavior

The task should be cacheable when the process tree does not actually modify an inferred input. In this fixture, a subsequent identical run should be able to hit the cache.

Actual behavior

On Windows, fspy reports the workspace root as both read and written. Vite Task treats the empty workspace-relative path as an input/output overlap and skips the cache update.

Analysis

TrackedPathAccesses::from_raw strips the workspace root from absolute paths. An access to the root itself therefore becomes an empty RelativePathBuf, which is retained in both path_reads and path_writes:

https://github.com/voidzero-dev/vite-task/blob/cb580c214bb2314fc1f633a3812782c9b3a1d956/crates/vite_task/src/session/execute/tracked_accesses.rs

observe_fspy then performs an exact intersection between the inferred read and write path sets. The empty path is returned as read_write_overlap, causing CacheNotUpdatedReason::InputModified:

https://github.com/voidzero-dev/vite-task/blob/cb580c214bb2314fc1f633a3812782c9b3a1d956/crates/vite_task/src/session/execute/cache_update.rs

One possible source of the false positive is the Windows access-mode mapping. The Windows preload records the requested access mask when intercepting NtCreateFile/NtOpenFile, before forwarding the real call. Directory access rights share bit values with FILE_WRITE_DATA and FILE_APPEND_DATA, so opening a directory with the capability to add children may be classified as a write even when the process does not mutate it.

The existing diagnostic only contains the aggregated path. It does not identify the originating PID/process, access mask, create disposition/options, or whether the intercepted call succeeded, so the exact syscall in the Bun process tree is not yet known.

A regression test should preserve real root-directory input tracking while ensuring that a directory-handle access which does not mutate the workspace does not make an otherwise cacheable Windows task permanently uncacheable.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne in crates/vite_task/src/session/execute/tracked_accesses.rs und cache_update.rs, verfolge TrackedPathAccesses::from_raw und beobachte observe_fspy, um zu verstehen, wie der leere workspace-relative Pfad zu einer Überschneidung wird. Reproduziere den Windows-Fall vite_task_bunx_wrapper::vite_task_bunx_wrapper und untersuche die Windows-Zugriffsverfolgung rund um den echten Bun-Prozessbaum. Als abgeschlossen gilt die Arbeit, wenn ein Regressionstest die Eingabeverfolgung des Stammverzeichnisses beibehält, während ein Zugriff, der den Workspace nicht verändert, das Caching nicht länger verhindert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
bun, rust
Bereich
devtools, operating-systems, testing-qa
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.