Skip to content

Cache miss on repeated pack builds: task modifies its own input #1095

@fengmk2

Description

@fengmk2

Summary

When running vp run <pkg>#build twice in a monorepo with vp pack, the second run is not cached. The task is reported as "not cached because it modified its input."

Reproduction

This was observed in the command-pack-monorepo snap test (see PR #1072). After an initial vp run hello#build, running it again produces:

vp run: hello#build not cached because it modified its input. (Run `vp run --last-details` for full details)

Running vp run --last-details reveals two different causes across runs:

→ Not cached: read and wrote 'packages/hello/dist/index.cjs'
→ Not cached: read and wrote 'node_modules/.vite-temp/vite.config.ts.timestamp-1774171302767-0e1b7c94f16fd.mjs'

Analysis

There appear to be two separate issues causing cache invalidation:

  1. Output files in input scope: The build output (dist/index.cjs) is being tracked as both an input and output of the task, so the task always appears to modify its own input.

  2. Vite temp config files: Vite writes a temporary config file to node_modules/.vite-temp/ which is also tracked as an input, causing cache invalidation.

Both of these should likely be excluded from the input fingerprint for vp pack builds.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions