`pkg_rpm` cannot set different permissions to the executable in `pkg_files` and to its runfiles
メンテナーはふだん 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 の本文から書いたものです。
説明
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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bazelbuild/rules_pkg のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
bazelbuild/rules_pkg#1093 ·
メンテナーはふだん 1 日以内に返信
-
Targets rely on implicit `__init__.py` creation, causing rules_python deprecation warnings対応中かも @onnosteenbergen-samotics が 33 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
bazelbuild/rules_pkg#1081 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
design feature-request
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
bazelbuild/rules_pkg#1080 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
bazelbuild/rules_pkg#1075 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
bazelbuild/rules_pkg#1066 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
bazelbuild/rules_pkg の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
open-jarvis/OpenJarvis#1212 ·
メンテナーはふだん 4 日以内に返信
-
Pin the Rust versionオープンgood first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
CakeRepository/agentshangout#3 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
objectionary/game-of-life#74 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dsh-market/dsh-market#1072 ·
メンテナーはふだん 1 日以内に返信
-
FnOS store-version conversion aborts on a leading-zero release segment because the patch is evaluated as octal対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
TencentCloud/Octop#2698 ·
メンテナーはふだん 1 日以内に返信