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

`pkg_rpm` cannot set different permissions to the executable in `pkg_files` and to its runfiles

Abierto
#836 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
Estancado
Área
build-system

Línea de trabajo

Comienza con la lógica de detección de ejecutables y configuración del modo en pkg/private/pkg_files.bzl, en las ubicaciones enlazadas, y después sigue cómo pkg_rpm consume PackageFilesInfo y gestiona include_runfiles. Revisa las pruebas relevantes de pkg_rpm o añade una reproducción específica para un ejecutable con runfiles. Se considera terminado cuando el ejecutable y sus runfiles pueden recibir modos diferentes, y el ejecutable conserva su bit de ejecución previsto.

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

Descripción

P2
The problem

pkg_tar automatically detects the executable in pkg_files:
https://github.com/bazelbuild/rules_pkg/blob/c53ff51070c96b368188f057a6683d97c31b77f7/pkg/private/pkg_files.bzl#L395

And sets its execution bit:
https://github.com/bazelbuild/rules_pkg/blob/c53ff51070c96b368188f057a6683d97c31b77f7/pkg/private/pkg_files.bzl#L411

pkg_rpm does not seem to do anything similar, so executables end up with the same file mode as the rest of the files in the provider, which is usually a mode without the execution bit.

Workaround

A workaround is to set the execution bit for the pkg_files target, which will set it for the executable and all its runfiles, but this is not ideal. It would be better if the default was to preserve the file mode of the source file, I think that would work reasonably well.

Future work

This highlights a general issue with the include_runfiles attribute in pkg_files: because the executable and all its runfiles are grouped inside a single PackageFilesInfo provider, there is no granularity to have different attributes or prefixes for different files.

There is also the issue of executables being included twice, as the main target, and as one of the runfiles, which makes a warning show up (file mapped to two different destinations). This should probably have its own issue 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.