Skip to content

feat(coreutils): the rest of the toolbox — grep, find, xargs, sed, tar, gzip, zstd - #453

Open
raphaelvigee wants to merge 1 commit into
raphaelvigee/core-utils-templating-enginefrom
raphaelvigee/coreutils-rest-of-toolbox
Open

raphaelvigee wants to merge 1 commit into
raphaelvigee/core-utils-templating-enginefrom
raphaelvigee/coreutils-rest-of-toolbox

Conversation

@raphaelvigee

@raphaelvigee raphaelvigee commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

The seven utilities a build recipe reaches for that uutils does not carry, so the toolbox covers a real recipe rather than only the easy half of one. Each is the same shape as the applets already in the table — a name, a run fn, golden tests — and each is here for a divergence that bites in practice.

  • grep, find, xargs (grep-*, ignore) — BSD find has no -printf, and the two xargs disagree about -r. Built on the crates ripgrep uses, so the matcher is a known quantity rather than a fresh regex engine.
  • sed — the divergence that started this. GNU takes an optional -i suffix, BSD requires one, so sed -i 's/a/b/' f edits in place on Linux and eats the next argument as a filename on macOS.
  • tar, gzip, zstd — reproducible by construction: no mtimes, no uid/gid, no name ordering left to readdir, compression levels pinned. An archive is usually a build output, so a tar that embeds a timestamp is a target that can never be a cache hit twice.

Why one PR and not three

This replaces #442, #443 and #444's applet halves. They touch the same four files — Cargo.toml, the applet table, a module apiece, COREUTILS.md — and ask the reviewer the same question three times: is this the right crate, and is the behaviour right. The applet set reads better judged in one pass.

#441 shows as "merged" through no merge to master. Consolidating reordered the stack so that PR's old base branch came to contain its head, and GitHub closed it as merged and deleted the branch. The commits are here; nothing reached trunk.

Every layer of the stack builds, lints and passes its unit tests independently.


The stack

Merge bottom-up, and gh stack sync after each one lands — master is squash-only, so the rebase will conflict and the resolution rule in CLAUDE.md applies.

PR What
6 #446 drop the host directories from a target's PATH — breaking
5 #445 the toolbox on by default
4 #440 the template rule and the tmpl applet
3 #453 grep, find, xargs, sed, tar, gzip, zstd
2 #438 the crate, the entry points, the shim directory
1 #451 the runner PATH seam ← base, targets master

Only #451 builds automatically: since #449 a stacked PR is skipped unless it carries ci/force-ci. Every layer was checked locally on its own — cargo build --workspace --all-targets, cargo clippy --workspace --all-targets, and its unit tests — not just at the top of the stack.

🤖 Generated with Claude Code

https://claude.ai/code/session_0181d7hhbYWXT42Z1KQPM29Q

…r, gzip, zstd

The seven utilities a build recipe reaches for that uutils does not carry, so
the toolbox covers a real recipe rather than only the easy half of one. Each is
the same shape as the applets already in the table — a name, a `run` fn, golden
tests — and each is here for a divergence that bites in practice:

- `grep`, `find`, `xargs` (`grep-*`, `ignore`): BSD `find` has no `-printf`, and
  the two `xargs` disagree about `-r`. Built on the crates ripgrep uses, so the
  matcher is a known quantity rather than a fresh regex engine.
- `sed`: the divergence that started this. GNU takes an optional `-i` suffix,
  BSD requires one, so `sed -i 's/a/b/' f` edits in place on Linux and eats the
  next argument as a filename on macOS.
- `tar`, `gzip`, `zstd`: **reproducible by construction** — no mtimes, no uid/
  gid, no name-ordering left to readdir, and compression levels pinned. An
  archive is usually a build *output*, so a tar that embeds a timestamp is a
  target that can never be a cache hit twice.

Landed as one change rather than three: they touch the same four files
(`Cargo.toml`, the applet table, a module apiece, `COREUTILS.md`) and ask the
reviewer the same question — is this the right crate, and is the behaviour
right — so the applet set reads better judged in one pass than in three.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0181d7hhbYWXT42Z1KQPM29Q

This branch has not been deployed

No deployments
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.

1 participant