A miss on a fresh checkout runs `tsc --incremental` with no build info, though the step's entry archived it
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
- Type d'issue
- Fonctionnalité
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- rust, typescript
- Domaine
- build-system, tooling
Piste de recherche
Start with the cache restore path in crates/vt/src/session/cache/mod.rs, especially ExecutionCache::restore and the remote validation path at lines 446–451. Then read crates/vt/src/session/execute/cache_update.rs to see how task outputs are recorded. Implementing this spans local and remote archives, missing-file handling, and modification times; done means a task can opt in to restoring a missing listed file on a cache miss while existing behavior remains intact.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Written by an AI agent (Claude) on behalf of @jasonkuhrt.
Part of the work in #929. Since #913, a task that rewrites its tool cache, such as tsc --incremental with tsconfig.tsbuildinfo, is cached, and a hit restores that file with the task's other outputs. A miss restores nothing, so on a fresh checkout, which is where CI runs, every miss starts the tool cold.
What happens
// vite.config.ts
import { defineConfig } from 'vite-plus';
export default defineConfig({
run: {
tasks: {
'check:types': { command: 'tsc --incremental --noEmit' },
},
},
});
- A run on
mainexecutescheck:types.tscwritestsconfig.tsbuildinfo, and the entry archives it as an output. - A pull request edits
src/a.ts. CI checks out a fresh tree, so there's no build info on disk. The entry under the step's cache key fails validation ('src/a.ts' modified), so it's a miss. tscruns with no build info and checks every file. The entry's archive holds the build info from step 1, but only a hit extracts it (ExecutionCache::restore,crates/vt/src/session/cache/mod.rs:589atc4b2aacf). For a remote entry, a failed validation also means its archive is never downloaded (mod.rs:446-451).
With incremental compilation enabled, TypeScript records each input's content version in its build info, so the next compilation can skip what hasn't changed (incremental).
The ask
A per-task list of tool cache files that a miss restores from the entry under the step's cache key, before the command runs:
'check:types': {
command: 'tsc --incremental --noEmit',
cache: { restoreOnMiss: ['tsconfig.tsbuildinfo'] },
},
The name is only a suggestion.
Which files qualify
- Only a cache the tool validates itself. Listing a file says the command's result is the same with or without it. A cache whose keys can miss a change, such as a transform cache keyed by a module's text alone, doesn't qualify. The runner can't tell the two apart, so this is opt-in per file.
- Not an emitting build. An emitting build's build info vouches for its emitted files, and TypeScript emits only the files it finds affected. Build info restored beside missing or older outputs would leave them wrong, and restoring the two together would need all-or-nothing rules this ask doesn't cover. That's why the example is
--noEmit.
Where the copy comes from
The entry under the step's current cache key (same command, env and cache config):
- A local entry: the listed files are extracted from its archive in the cache directory.
- A remote entry: its archive is downloaded and the listed files are extracted. Only a task that lists files pays for that download.
- A remote fallback names another key and carries no archive, so it restores nothing.
- No entry under the key in either tier, as on a first run: nothing is restored, and the command runs as it does today.
When a file is restored
- Only when it's missing, which is the fresh-checkout case. A file already on disk is the tool's latest state, possibly from a run that failed and so stored no entry (
crates/vt/src/session/execute/cache_update.rs:90-91), and is left alone. - With its archived modification time, as a hit's outputs are today.
tsc --build's up-to-date check compares modification times, so build info dated at restore can make changed inputs look up to date there. #881 proposes dating a hit's outputs when they land; a file restored on a miss needs its archived time either way. - Never at the task's expense: a listed file the archive doesn't hold, or a restore that fails, leaves the command to run as it does today.
What the run records
- A listed file counts as one the run wrote. It's archived from disk after the run and recorded as possibly missing, as #913 records a file a task rewrites, even when this run only read it. Otherwise a run that reads the build info without rewriting it would store an entry that requires the file and holds no copy of it.
- A positive
cache.inputglob that matches a listed file keeps its meaning today: it's hashed before the run.
What stays the same
- A hit restores every output, the listed files included.
--dry-run(#933, proposed) downloads and restores nothing, so this changes no status it reports.
Alternatives considered
- Restore every file a task rewrites. That includes caches that can change the result, and the runner can't tell which those are.
CACHEDIR.TAG(#793). A tag says a directory is a cache, not that its tool validates it, so it can't opt a directory into this. A tool that tags its cache could still list it here.- The CI provider's cache (GitHub's
actions/cache, a runner's persistent disk). It needs the path and a key per job and per provider, outside the task graph, while Vite Task already holds the file in the step's entry.
Our case
We restore build info today with a wrapper around each type-check command: it fetches the branch's last build info from our own server before tsc runs and stores it after. With this, Vite Task would restore it from the entry it already holds, and the wrapper's restore and store would go. Our pnpm layout also needs the build info's dependency paths rewritten for the machine, which stays on our side.
- Langage dominant
- Rust
- Étoiles
- 485
- Forks
- 51
- Merge moyen
- 23 h 20 min
- PR mergées (30 j)
- 56
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de voidzero-dev/vite-task
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
voidzero-dev/vite-task#938 ·
Les mainteneurs répondent en général sous 1 jour
-
fspy linux backend
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 6/100
voidzero-dev/vite-task#932 ·
Les mainteneurs répondent en général sous 1 jour
-
remote cache
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 12/100
voidzero-dev/vite-task#931 ·
Les mainteneurs répondent en général sous 1 jour
-
☂️ Release remote cachingOuverteremote cache
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 5/100
voidzero-dev/vite-task#930 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
read-write overlap
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 5/100
voidzero-dev/vite-task#929 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de voidzero-dev/vite-task
Issues similaires
-
A match arm above the largest i64 is compared as 0Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 83/100
DioxusLabs/dioxus#6063 ·
Les mainteneurs répondent en général sous 1 jour
-
`nsh-core` fails to compile when taffy's default `calc` feature is enabled elsewhere in the graphOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
longbridge/nsh#966 ·
Les mainteneurs répondent en général sous 1 jour
-
Windows docs: pin a tested ConPTY version for Kitty graphics; 1.25.260930003 corrupts large uploadsOuverte
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
raphamorim/rio#2021 ·
Les mainteneurs répondent en général sous 1 jour
-
Docs: status text is out of dateOuvertedocumentation
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
non7top/sigstore-shell#38 ·
Les mainteneurs répondent en général sous 1 jour