Expose the buf CLI as a supported target (@rules_buf_toolchains//:buf is not visible under Bazel 10)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 66/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- build-system
調査の方向性
Start by reading the generated toolchains repository BUILD setup and the code that selects native_binary by operating system; the issue does not name those files. Check how the buf toolchain exposes its CLI and how existing executable targets are documented. Done means users have a supported, documented executable target for the downloaded buf CLI that works across platforms.
索引モデルが issue の本文から書いたものです。
説明
There is currently no documented way to use the buf CLI downloaded by rules_buf as a tool, for example as the formatter in rules_multirun, a bazel run target or a genrule.
Users reach for @rules_buf_toolchains//:buf, but on Linux and macOS that label is a plain source file (the downloaded binary), and Bazel 10 stops that from working.
Request
Expose the buf CLI as a supported, documented executable target.
For example, always wrap it in native_binary (not just on Windows) and document it, or expose it from the rules_buf repo.
What breaks under Bazel 10
Bazel 10 no longer exports source files implicitly (--incompatible_no_implicit_file_export, see the file visibility proposal).
The generated rules_buf_toolchains repo sets default_visibility to public, but buf is only a source file on non-Windows platforms (native_binary is used only when os == "windows"), so it is not exported.
That is consistent with the proposal, so this is not a bug in itself.
It does show that depending on this label was never safe.
With rules_buf 0.6.1 and Bazel 10.0.0rc4:
alias(
name = "buf",
actual = "@rules_buf_toolchains//:buf",
)
bazel build //:buf fails with:
ERROR: in alias rule //:buf: Visibility error:
target '@@rules_buf++buf+rules_buf_toolchains//:buf' is not visible from target '//:buf'
The same build succeeds with --noincompatible_no_implicit_file_export, so the cause is the new default.
Options
- Add a supported buf target (preferred).
- As a minimal stopgap, add
exports_files(["buf", "protoc-gen-buf-lint", "protoc-gen-buf-breaking"])to the generated toolchains BUILD file, which makes the export explicit.
Workaround
Resolve the registered toolchain (@rules_buf//tools/buf:toolchain_type) in a small rule and expose its cli as an executable.
I could not find an existing issue about this.
- 主要言語
- Starlark
- スター
- 64
- フォーク
- 41
- 平均マージ
- 3時間 49分
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bufbuild/rules_buf のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
bufbuild/rules_buf#131 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
メンテナーはふだん 1 日以内に返信
bufbuild/rules_buf の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
oracle/graalvm-reachability-metadata#12264 ·
メンテナーはふだん 1 日以内に返信
-
A-Packaging C-Bug D-Straightforward S-Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
cli/gh-extension-precompile#110 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
qoretechnologies/qore#8403 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
omarelshamy25x/shamy-arabic-nlp#92 ·
メンテナーはふだん 1 日以内に返信