rtk-ai/rtk

Feature request: add support for Bazel/Bazelisk

Open

#1061 aperta il 7 apr 2026

Vedi su GitHub
 (2 commenti) (1 reazione) (0 assegnatari)Rust (2914 fork)batch import
area:clieffort-largeenhancementhelp wantedpriority:low

Metriche repository

Star
 (48.085 star)
Metriche merge PR
 (Merge medio 11g 1h) (45 PR mergiate in 30 g)

Descrizione

Summary

Bazel (and Bazelisk) builds can be extremely verbose and would benefit from RTK filtering for Java/JVM developers using Bazel as their build system.

Why Bazel needs a dedicated Rust module (not just TOML)

Bazel sends most of its output (progress, errors, summaries) to stderr, not stdout. TOML filters only capture stdout, so they miss ~90% of Bazel's output. A dedicated Rust module using runner::run_filtered can capture and filter both streams.

Commands that should be supported

  • bazel build / bazelisk build — strip [X / Y] progress lines, INFO: noise, Loading:, Analyzing:, repo cache info; keep ERROR: and build result
  • bazel test / bazelisk test — show only PASSED/FAILED per target and summary; strip progress noise
  • bazel query / cquery / aquery — strip INFO: and Loading: lines, keep target labels
  • bazel run — same filtering as build
  • bazel clean — compact output

Estimated savings

Operation Raw output Filtered Savings
bazel build (success) ~30 lines 1 line ~95%
bazel build (failure) ~30 lines 3-5 lines (errors only) ~85%
bazel test (all pass) ~20 lines 1 line ~95%
bazel query //... ~10+ INFO lines + targets targets only ~50-80%

Reference implementation

I have a working implementation in my fork: https://github.com/tructxn/rtk/commit/58fb4ef

Key files:

  • src/cmds/jvm/bazel_cmd.rs — dedicated Rust module with build/test/query/run/clean filters (13 unit tests)
  • src/cmds/jvm/mod.rs — JVM ecosystem module
  • src/filters/bazel-build.toml, bazel-test.toml, bazel-query.toml — TOML fallback filters for hook rewrite path
  • src/main.rsCommands::Bazel with BazelCommands subcommands

All 1363 tests pass. Regex matches both bazel and bazelisk via ^bazel(isk)?.

Guida contributor