rust-analyzer tools: workspace-wide extra Bazel flags

Abierto
#4,505 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

Start by reading the rust-analyzer tool entry points discover_rust_project, gen_rust_project, and flycheck, which the issue says run bazel info and bazel build. Trace how their existing bazel_args are passed and how the proposed //tools/rust_analyzer:extra_bazel_args build setting could reach those calls. Done means workspace .bazelrc configuration supplies extra flags to every relevant Bazel invocation, with documentation and coverage for the tools.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

needs-triage

The rust-analyzer tools (discover_rust_project, gen_rust_project, flycheck) run bazel info and bazel build in the workspace, so they pick up the workspace .bazelrc. If that rc adds output groups or aspects to every build, for example clippy and other linters through --output_groups and --aspects, discovery builds them for every crate and gets much slower.

The tools already take bazel_args on their command line, but those have to be passed in each editor's config, by every developer. We'd like to set them once for the workspace.

What we run with is a repeatable string build setting, //tools/rust_analyzer:extra_bazel_args. It's read when the tools are built and added to every bazel info / bazel build they run, so a workspace sets it once in its .bazelrc:

common --@rules_rust//tools/rust_analyzer:extra_bazel_args=--config=ide

Is that something you'd take? If so I can send the PR, with docs. If you'd prefer another mechanism (an env var, or a file the tools read), I'm happy to do that instead.

Lenguaje dominante
Starlark
Estrellas
857
Forks
701
Merge medio
4 d 7 h
PR fusionados (30 d)
46

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bazelbuild/rules_rust

Todos los issues de bazelbuild/rules_rust

Issues similares

Más issues de Build System

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.