rtk-ai/rtk

Feature request: add support for Bazel/Bazelisk

Open

#1 061 ouverte le 7 avr. 2026

Voir sur GitHub
 (2 commentaires) (1 réaction) (0 assignés)Rust (2 914 forks)batch import
area:clieffort-largeenhancementhelp wantedpriority:low

Métriques du dépôt

Stars
 (48 085 stars)
Métriques de merge PR
 (Merge moyen 11j 1h) (45 PRs mergées en 30 j)

Description

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)?.

Guide contributeur