Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

A cache hit drops the symbolic links in a task's outputs

Ouverte
#884 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

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
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
rust
Domaine
build-system

Piste de recherche

Start with create_output_archive in crates/vt/src/session/cache/archive.rs and walk_glob_files in crates/vt/src/session/execute/glob.rs; the issue describes how both handle symbolic links. Reproduce with the provided task, then check the cache archive and glob behavior for links. Done when a cache hit restores links matched by an output glob; automatic tracking of created links is explicitly left open.

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.

A cache hit leaves out the symbolic links a task created in its outputs, so the replayed output differs from the one the task produced.

We hit it with Nitro's server build: its dependency tracer (nf3) writes server/node_modules/tslib -> .nf3/[email protected]. After a hit, the link is gone, and the replayed server resolves tslib outside its own output, or not at all.

Repro. A package with this script and task:

// make-link.mjs
import fs from 'node:fs';
fs.mkdirSync('dist/.store/pkg', { recursive: true });
fs.writeFileSync('dist/.store/pkg/index.js', 'export default 42;');
fs.symlinkSync('.store/pkg', 'dist/pkg');
// vite.config.ts
export default defineConfig({
  run: {
    tasks: {
      build: {
        command: 'node make-link.mjs',
        cache: { output: [{ auto: true }, 'dist/**'] },
      },
    },
  },
});

vp run build, rm -rf dist, vp run build again: the second run is a cache hit, dist/.store/pkg/index.js is back, and dist/pkg is missing.

Causes (at 0346c268):

  1. create_output_archive reads each output with std::fs::metadata, which follows links, and archives regular files only: a directory link is skipped, and a file link would be stored as a copy of its target.
  2. walk_glob_files keeps only is_file() entries, so an output glob never lists a link.
  3. Automatic output tracking never sees a link being created: fspy has no interceptor for symlink/symlinkat (preload interceptions, and the Linux syscall handler), nor CreateSymbolicLinkW on Windows. So even with 1 and 2 fixed, { auto: true } alone can't list a created link; it takes an output glob that matches it.

A fix for 1 and 2 follows in a PR. 3 is left open here.

Langage dominant
Rust
Étoiles
480
Forks
50
Merge moyen
1 j 3 h
PR mergées (30 j)
62

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de voidzero-dev/vite-task

Toutes les issues de voidzero-dev/vite-task

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.