Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#884 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
build-system

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
480
Forks
50
Merge medio
1 d 3 h
PR fusionados (30 d)
62

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de voidzero-dev/vite-task

Todos los issues de voidzero-dev/vite-task

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.