Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#836 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
領域
build-system

調査の方向性

リンク先の箇所にある pkg/private/pkg_files.bzl の実行可能ファイルの検出およびモード設定ロジックから始め、次に pkg_rpm が PackageFilesInfo をどのように消費し、include_runfiles をどのように処理するかを追跡します。関連する pkg_rpm のテストを確認するか、runfiles を持つ実行可能ファイルについて焦点を絞った再現ケースを追加します。実行可能ファイルとその runfiles に異なるモードを設定でき、実行可能ファイルが本来の実行ビットを維持できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Starlark
スター
254
フォーク
225
平均マージ
2日 4時間
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bazelbuild/rules_pkg のほかの issue

bazelbuild/rules_pkg の issue をすべて見る

似ている issue

Build System の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。