Skip to content

Feature request: add support for Bazel/Bazelisk #1061

Open

Description

@tructxn

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: tructxn@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.rs — Commands::Bazel with BazelCommands subcommands

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

Activity

  1. mxmaxime commented on Apr 9, 2026

    @mxmaxime

    That seems amazing, thanks!
    Your link is broken sadly.

  2. pszymkowiak commented on Apr 12, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    ✨ Category feature
    🟢 Priority low
    🎯 Confidence 92%

    Summary

    Feature request for Bazel/Bazelisk build filtering support; a linked PR (#1128) already covers this, making the issue largely addressed.

    📁 Relevant files
    • src/cmds/jvm/bazel_cmd.rs
    • src/cmds/jvm/mod.rs
    • src/main.rs
    • src/filters/bazel-build.toml
    • src/filters/bazel-test.toml
    • src/filters/bazel-query.toml

    Triaged automatically by wshm · This is an automated analysis, not a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions