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; keepERROR:and build resultbazel test/bazelisk test— show only PASSED/FAILED per target and summary; strip progress noisebazel query/cquery/aquery— stripINFO:andLoading:lines, keep target labelsbazel run— same filtering as buildbazel 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 modulesrc/filters/bazel-build.toml,bazel-test.toml,bazel-query.toml— TOML fallback filters for hook rewrite pathsrc/main.rs—Commands::BazelwithBazelCommandssubcommands
All 1363 tests pass. Regex matches both bazel and bazelisk via ^bazel(isk)?.