You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5cdc29e
Browse filesBrowse the repository at this point in the historyBrowse files
feat(cache): let a hit rebuild empty folders the task made
A task that makes a folder and leaves it empty, like `astro build` making
`.astro/collections`, pinned the folder holding it as an input: fspy
didn't record a mkdir as one (on Windows it was a read), so the empty
folder wasn't rebuildable, and the archive held only files, so a hit
couldn't recreate it. Removing the folder, as on a clean checkout, was a
cache miss.
fspy now records the path of a mkdir as a mkdir, a new access kind, before
the call, so a failed call, like one finding the folder there already, is
recorded too:
- Unix preload: `mkdir` and `mkdirat`.
- Linux seccomp supervisor, for static binaries: `mkdirat`, plus `mkdir`
on x86_64.
- Windows: `NtCreateFile` with `FILE_DIRECTORY_FILE` and `FILE_CREATE` or
`FILE_OPEN_IF`, where `CreateDirectoryW` ends. These opens were recorded
as reads; a mkdir isn't one on Unix either.
`Rebuildable` takes the mkdirs that are empty folders after the run
(`.DS_Store` aside) as rebuildable folders and climbs from them too, so a
folder holding only such folders, rebuildable folders and files the task
wrote is rebuildable. Each folder is listed once: a mkdir'd folder above a
written path is decided while climbing, where an empty one counts as
rebuildable, and only the other mkdirs are checked for being empty. A run
without inferred reads skips the climb and checks every mkdir, for the
archive.
The archive gets directory entries for the empty folders, filtered by
output exclusions and `ignoreOutput` like files: all of them with
automatic output tracking, and otherwise those an `output` glob matches,
since the glob walk yields files only. Restoring recreates them. A folder
holding anything needs no entry, since what it holds recreates it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# Changelog
2
2
3
+
-**Fixed** A cache hit now restores the empty folders a task made if they're among its outputs, like the `.astro/collections` folder that `astro build` leaves empty: with automatic output tracking that's every such folder, and with `output` globs, the ones they match. A folder holding only such folders and files the task wrote, like `.astro`, may now be missing, as on a fresh clone, and the next run is still a cache hit, which restores it if what it holds is among the task's outputs. Previously a hit left empty folders missing, and removing a folder holding one was a cache miss ([#917](https://github.com/voidzero-dev/vite-task/pull/917)).
3
4
-**Fixed** A task's automatically tracked outputs now include the files it renames into place, like Vitest's `fsModuleCache` entries written under a temporary name, every file in a folder it renames into place, like Vite's dependency optimizer renaming `deps_temp_*` to `deps`, and the hard links it creates. The next run is a cache hit if they are missing, as on a fresh clone, and the hit restores them if they're among the task's outputs. Previously they weren't restored, and removing one that the task read back was a cache miss ([#916](https://github.com/voidzero-dev/vite-task/pull/916)).
4
5
-**Changed** When a task lists a folder, the files it wrote there and the folders holding only such files no longer count as entries of the listing: the next run is a cache hit if they are missing, as on a fresh clone, and the hit restores them if they're among the task's outputs. For example, `tsc` with no `include` lists the package root, which holds its `lib` output folder; removing `lib` used to be a cache miss. The folder's other entries still count ([#915](https://github.com/voidzero-dev/vite-task/pull/915)).
5
6
-**Changed** A task that checks or lists a folder holding only files it wrote, like `tsc` checking its `dist` output folder, is now a cache hit when the folder is missing, as on a fresh clone, and the hit restores the folder if its files are among the task's outputs. Previously the missing folder was a cache miss ([#914](https://github.com/voidzero-dev/vite-task/pull/914)).
0 commit comments