Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#836 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Ambito
build-system

Direzione di ricerca

Inizia dalla logica di rilevamento degli eseguibili e di impostazione della modalità in pkg/private/pkg_files.bzl nelle posizioni collegate, quindi segui il modo in cui pkg_rpm consuma PackageFilesInfo e gestisce include_runfiles. Controlla i test pertinenti di pkg_rpm oppure aggiungi una riproduzione mirata per un eseguibile con runfiles. Il lavoro è completato quando l’eseguibile e i suoi runfiles possono ricevere modalità diverse, mantenendo l’eseguibile il bit di esecuzione previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Starlark
Stelle
254
Fork
225
Merge medio
2g 4h
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bazelbuild/rules_pkg

Tutte le issue di bazelbuild/rules_pkg

Issue simili

Altre issue su Build System

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.