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

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

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
bun, rust

调研方向

从 crates/vite_task/src/session/execute/tracked_accesses.rs 和 cache_update.rs 开始,跟踪 TrackedPathAccesses::from_raw 并观察 observe_fspy,以了解空的相对于 workspace 的路径如何变成重叠。复现 Windows 的 vite_task_bunx_wrapper::vite_task_bunx_wrapper 案例,并检查真实 Bun 进程树周围的 Windows 访问跟踪。当回归测试保留根目录输入跟踪,同时不修改 workspace 的访问不再阻止缓存时,即表示完成。

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

描述

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.

主要语言
Rust
星标
466
派生
42
平均合并
1 天 20 小时
30 天内合并 PR
21

贡献指南

打开贡献指南

从这里开始

  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 摘要。