Expose the buf CLI as a supported target (@rules_buf_toolchains//:buf is not visible under Bazel 10)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 66/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Domínio
- build-system
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Starlark
- Estrelas
- 64
- Forks
- 41
- Merge médio
- 3h 49min
- PRs com merge (30d)
- 10
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de bufbuild/rules_buf
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 38/100
bufbuild/rules_buf#131 · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
Bug in root module detectionAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 52/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 38/100
Mantenedores costumam responder em até 1 dia
Todas as issues de bufbuild/rules_buf
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
oracle/graalvm-reachability-metadata#12264 ·
Mantenedores costumam responder em até 1 dia
-
A-Packaging C-Bug D-Straightforward S-Needs-Triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
cli/gh-extension-precompile#110 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 69/100
qoretechnologies/qore#8403 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
good first issue help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
omarelshamy25x/shamy-arabic-nlp#92 ·
Mantenedores costumam responder em até 1 dia