Skip to content

feat(cmake): add cmake build/configure filter#2778

Closed
cc1a2b wants to merge 1 commit into
rtk-ai:developfrom
cc1a2b:feat/cmake-filter
Closed

feat(cmake): add cmake build/configure filter#2778
cc1a2b wants to merge 1 commit into
rtk-ai:developfrom
cc1a2b:feat/cmake-filter

Conversation

@cc1a2b

@cc1a2b cc1a2b commented Jul 1, 2026

Copy link
Copy Markdown

Summary

  • Fixes Add rtk cmake filter (collapse build progress, keep diagnostics) #2236: adds a compact rtk cmake filter (new native ecosystem for C/C++ tooling).
  • cmake --build prints one [ NN%] Building ... line per translation unit plus make[N] "Entering/Leaving directory" chatter; a configure run emits a probe line per feature check. Once the build is green, none of that carries signal.
  • The filter tallies objects/targets and drops the progress + probe spam, while keeping warnings, errors and the configure verdict verbatim. On failure it drops progress and preserves the diagnostics in full.

Behaviour

Input Output
green cmake --build (progress spam + 1 warning) cmake: built N targets, M objects + the warning
failed build cmake: build failed (exit N) + the compiler diagnostics
cmake -S -B configure keeps -- Configuring done / Build files written, drops -- Detecting/Check/Performing Test spam

On the fixture in the tests this is ~85% smaller (well past the 60% bar).

Wiring (per src/cmds/README.md#adding-a-new-command-filter)

  • src/cmds/native/{mod.rs,cmake_cmd.rs,README.md} — new ecosystem + filter (pure &str -> String, run() via run_filtered_with_exit + with_tee("cmake") for raw recovery).
  • src/cmds/mod.rs — register native.
  • src/main.rsCmake subcommand + routing; added to is_operational_command so hook-rewritten cmake is integrity-checked (fails-open otherwise).
  • src/discover/rules.rs^cmake\brtk cmake rewrite rule.
  • src/cmds/system/pipe_cmd.rs"cmake" in the filter resolver (so rtk pipe/smart can reach it).

Tests

cargo test --bin rtk cmake_cmd — 3 pass (progress collapse + ≥60% savings, failure keeps diagnostics, configure drops probe spam). cargo fmt --check and cargo clippy --all-targets clean; test_every_subcommand_is_classified updated (cmake added to PASSTHROUGH).

Closes #2236

Adds a `native` ecosystem with an `rtk cmake` filter. `cmake --build` prints one
`[ NN%] Building ...` line per translation unit plus `make[N]` directory chatter,
and configure runs emit a probe line per feature check — all of it noise once the
build succeeds.

The filter tallies objects/targets and drops the progress + probe spam while
keeping warnings, errors and the configure verdict verbatim; on failure it drops
progress and preserves the diagnostics in full. ~85% smaller on a real build.

Wires cmake into the rewrite rules, the pipe/smart filter resolver, and the
operational-command integrity whitelist.

Closes #2236
@CLAassistant

CLAassistant commented Jul 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cc1a2b

cc1a2b commented Jul 6, 2026

Copy link
Copy Markdown
Author

Withdrawing this one to tidy up my open contributions — feel free to pick up the diff if the cmake filter is ever wanted.

@cc1a2b cc1a2b closed this Jul 6, 2026
@KnoerleMaTLS

Copy link
Copy Markdown

@aeppling Could we bring this feature in please? Would be nice for C/C++ developers i think.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rtk cmake filter (collapse build progress, keep diagnostics)

3 participants