Skip to content

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

Description

@jasonkuhrt

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions