rust-analyzer tools: workspace-wide extra Bazel flags

Aperta
#4,505 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Starlark
Stelle
857
Fork
701
Merge medio
4g 7h
PR unite (30g)
46

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bazelbuild/rules_rust

Tutte le issue di bazelbuild/rules_rust

Issue simili

Altre issue su Build System

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.