Skip to content

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

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.

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