Skip to content

feat: add rtk make wrapper (strip recipe echo + directory chatter, keep diagnostics) #3487

Open

Description

@nitrocode

Summary

Add an rtk make subcommand that wraps make, following the same pattern as rtk cargo / rtk mvn / rtk gradlew / rtk go. Currently make has no first-class filter, and (per #1714) the hook rewrites make <target> to rtk make <target>, which clap rejects since no such subcommand exists — every make invocation goes through a parse-and-fallback round trip before running raw. Related but distinct: #2236 (cmake filter), #1035 (composite-command tail loss), #1714 (rewrite false positive).

Why

make remains the default entry point for a lot of repo-local task runners (make test, make build, make check, make lint). Its output is dominated by two low-signal noise sources:

  • Recipe echo: every non-@-prefixed recipe line is printed before execution.
  • Directory chatter: make[1]: Entering directory ... / Leaving directory ... on every recursive invocation.

Local frequency data from one heavy user (rtk history.db, ~30 day window): 102 make ... invocations, 0 parsed successfully, 100% fell back to raw passthrough after a failed rtk make rewrite. Every one is currently a guaranteed wasted rewrite attempt with zero filter benefit.

Suggested behavior

Match the shape of rtk cmake (#2236):

  • On success: drop make[N]: Entering/Leaving directory lines and recipe-echo lines; leave sub-tool output alone so it can route through existing filters where applicable (a recipe running pytest still benefits from pytest-style filtering downstream).
  • On failure (non-zero exit or *** Error N): preserve the failing recipe line, the tool it invoked, and its diagnostics verbatim. Always keep the tail so the failure summary survives (see Output lost on composite commands (make ci-local / vitest) - summary lines removed #1035).
  • Pass -n / --dry-run / -p / --print-data-base through unfiltered (their whole point is verbose introspection).

Example

Input:

$ make test
make[1]: Entering directory '/proj/sub'
gcc -c foo.c -o foo.o
gcc -c bar.c -o bar.o
./run_tests
tests: 42 passed, 0 failed
make[1]: Leaving directory '/proj/sub'

Filtered:

tests: 42 passed, 0 failed

On failure, the failing recipe line + diagnostics stay verbatim.

Notes

Recipe output is heterogeneous by design (unlike cargo test/pytest, which have a fixed output contract), so the filter should be conservative: strip make's own framing, leave the recipe's own stdout/stderr alone (or delegate to an existing filter if the recipe is a known tool). Resolves the #1714 false-positive by making the rewrite target actually valid. If the surface area above is too broad for a first pass, a narrower v1 that just stops the wasted rewrite attempt (either by not rewriting make at all, or by stripping only the directory-chatter lines) would already fix the 0%-success problem.

Activity

  1. added
    enhancement
    help wanted
    on Aug 9, 2026
  2. pszymkowiak commented on Aug 9, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    ✨ Category feature
    🟡 Priority medium
    🎯 Confidence 92%

    Summary

    Add an rtk make subcommand filter (mirroring cmake/cargo/mvn/gradlew) to strip recipe echo and directory-chatter noise while preserving failure diagnostics; currently 100% of make invocations fail the rewrite and fall back to raw passthrough.

    📁 Relevant files
    • src/filters/cmake.rs
    • src/filters/make.rs
    • src/cli.rs

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

  3. DeepTrial commented on Aug 10, 2026

    @DeepTrial

    I'd like to take this. As a compiler developer I hit this constantly — every make invocation in my agent loops goes through a wasted rewrite round-trip and falls back to raw passthrough, so the directory chatter and recipe echo noise ends up in context. I'll implement rtk make as a first-class Rust subcommand (mirroring the existing rtk lit pattern) that suppresses make[N]: Entering/Leaving directory lines and preserves all sub-tool output, with the fallback-on-nonzero-exit guarantee. Plan to remove the now-redundant TOML [filters.make] rule and add unit tests + docs.

  4. DeepTrial commented on Aug 10, 2026

    @DeepTrial

    Implemented in PR #3515 (branch feat/make-wrapper, base rtk-ai/rtk:develop).

    What changed:

    • Added rtk make as a first-class Rust subcommand (src/cmds/system/make_cmd.rs) that suppresses make[N]: Entering/Leaving directory chatter and preserves all sub-tool output (gcc/clang/pytest diagnostics), collapsing fully-stripped runs to make: ok. Verbose flags pass raw output through.
    • This resolves the root cause of the rewrite round-trip: the hook rewrote make → rtk make, but no such subcommand existed, so rtk fell back to a raw exec and never filtered. Now clap resolves rtk make and routes to the new module.
    • Removed the now-redundant TOML [filters.make] and updated toml_filter built-in count/tests.
    • cargo fmt --all && cargo clippy --all-targets && cargo test --all all pass.

    Note: followed the conservative filter variant (directory chatter only; recipe echo left intact) per earlier discussion — recipe-echo suppression can be a follow-up if wanted.

    Fixes #3487.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clienhancementhelp wantedpriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions