Expose the buf CLI as a supported target (@rules_buf_toolchains//:buf is not visible under Bazel 10)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 66/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- build-system
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Starlark
- Estrellas
- 64
- Forks
- 41
- Merge medio
- 3 h 49 min
- PR fusionados (30 d)
- 10
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bufbuild/rules_buf
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
Improving dependency managementAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
bufbuild/rules_buf#131 · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
Bug in root module detectionAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
Todos los issues de bufbuild/rules_buf
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
oracle/graalvm-reachability-metadata#12264 ·
Los mantenedores suelen responder en 1 día
-
A-Packaging C-Bug D-Straightforward S-Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
cli/gh-extension-precompile#110 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
qoretechnologies/qore#8403 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
omarelshamy25x/shamy-arabic-nlp#92 ·
Los mantenedores suelen responder en 1 día