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

Support packaging raw symlinks from declare_symlink

Abierto
#929 1 comentario 3 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
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
build-system

Línea de trabajo

Empieza en pkg_files.bzl para rastrear cómo los artefactos File.is_symlink se convierten en entradas del manifiesto; después, lee build_tar.py, donde se procesan los tipos de entradas del manifiesto. La tarea estará terminada cuando los symlinks sin procesar produzcan entry_type=raw_symlink y el tar almacene el destino original del enlace en lugar de leer el archivo enlazado.

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

Descripción

feature-request P2

Over in rules_python, declare_symlink() is used to create symlinks for efficiency and correctness reasons. Such artifacts are "raw" symlinks, that is, Bazel will keep them exactly as-is and not try to transform them, as happens when using declare_file().

Unfortunately, pkg_tar gives an error when it sees these artifacts. What happens is it thinks the file is a regular file, so tries to read it. Since its a relative symlink, it either is dangling (in the context of pkg_tar), or will read the actual file (instead of creating a symlink), neither of which is desirable behavior.

Thankfully, starting in Bazel 8, File.is_symlink can be used to detect these artifacts. This allows the manifest that pkg_tar generates, and the build_tar program that uses it, to handle them correctly.

The two basic changes are:

  1. When File.is_symlink is true, write a manifest entry with entry_type=raw_symlink (pkg_files.bzl)
  2. Modify build_tar.py to handle entry_type=raw_symlink: read os.readlink() from the src file. Then store it as a symlink. This preserves the original symlink.

I prototyped this a bit and it seems to work. I'd reference my branch, but its in a very hacky and broken state right now. The above gets the gist though

Lenguaje dominante
Starlark
Estrellas
254
Forks
225
Merge medio
2 d 4 h
PR fusionados (30 d)
3

Preparar el entorno

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 bazelbuild/rules_pkg

Todos los issues de bazelbuild/rules_pkg

Issues similares

Más issues de Build System

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.