voidzero-dev / voidzero-dev/vite-task

Cache keys record absolute pnpm-store paths through `args`, so built-in-tool verdicts cannot cross machines

Open
#717 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
466
Forks
42
Avg merge
1d 15h
Merged PRs (30d)
19

Description

SpawnFingerprint normalizes cwd and the program to workspace-relative, collapsing an out-of-workspace program to its file name (crates/vite_task_plan/src/plan.rs:631-667, cache_metadata.rs:86-92), but args are keyed verbatim. When a user task's command is a vp built-in, the CLI's resolver returns an absolute binPath (oxlint, oxfmt, vitest, pack, vite) and it reaches plan_synthetic_request unchanged (plan.rs:546-577).

Under pnpm's global virtual store the key for vp lint --type-aware is program node_modules/.bin/node with args ['--disable-warning=...', '/Users/<user>/Library/pnpm/store/v11/links/@/oxlint/1.81.0/<hash>/node_modules/oxlint/bin/oxlint', ...], so no verdict replays between a CI runner and a developer checkout. In our monorepo that is 131 type-aware lint tasks whose cold lane takes about 5m39s; the same applies to vp fmt, vp pack and vp build tasks.

Request: fingerprint a core-resolved tool by identity (package name and version, which the core knows because it resolved the path), or relativize absolute args. The resolver also injects OXLINT_TSGOLINT_PATH into the key's tracked envs, whose value hashes a second store path, so args alone are not the whole key: replacing the built-in with sh -c 'vp lint ... "$@"' vp (no synthetic plan request, so neither the resolved path nor the resolver envs reach the key) is the workaround we landed, and the next run's miss message was env 'OXLINT_TSGOLINT_PATH' changed.

Separately, some recorded accesses in the entry value are a package prefix concatenated with an absolute path, e.g. tools/workspace-cache + /Users/<user>/<worktree>/tools/.../report.test.ts.mjs, which looks like a missed strip in auto-tracking.

Related: #591 (remote cache), for which cross-machine keys are a prerequisite.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read SpawnFingerprint in crates/vite_task_plan/src/plan.rs:631-667 and cache_metadata.rs:86-92, then trace plan_synthetic_request at plan.rs:546-577 for a built-in such as vp lint --type-aware. Reproduce the pnpm-store case and inspect tracked environment values and recorded accesses; done means the resulting key and accesses no longer depend on absolute store or worktree paths and built-in verdicts can replay across machines.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.