refactor(minimal): name the CLI binary target min - #737
Conversation
The user-facing command has been `min` for a while — clap says so
(`#[command(name = "min")]`) and the installer lays the binary down as
`bin/min` — but cargo still emitted `minimal`, and `min` was conjured by
a rename at release-staging time. So the dev build disagreed with what
ships: `just up` produced `target/debug/minimal`, while every doc and
every user typed `min`.
Declare the binary target explicitly instead:
[[bin]]
name = "min"
path = "src/main.rs"
Declaring a [[bin]] disables autodiscovery, so `src/main.rs` now builds
ONLY as `min`; the `minimal` lib target (and the package name, hence
`cargo build -p minimal`) are unchanged.
Callers updated: `--bin minimal` -> `--bin min` and the built-binary
paths in all five workflows (ci-linux-kvm, ci-linux-native, ci-macos,
nightly-tests, release), the KVM testbed staging that copies the CLI
onto PATH, session-e2e.sh's `mnl()` wrapper, and the justfile's binary
variable.
The published release ASSET names (minimal-linux-amd64, and so on) are
deliberately left alone: they are the contract the install manifest and
`scripts/install.sh` are built around, and renaming them would churn the
release channel for no user-visible gain. Only the local build-output
path feeding those steps changed.
Two `minimal` names that are NOT this binary and stay put: the macOS
shim (`~/.minimal/shim/bin/minimal`, which runs the CLI inside a VM —
`just artifacts` calls it), and the `minimal` crate/lib target.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe ChangesCLI binary rename
Estimated code review effort: 2 (Simple) | ~15 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
Resolve the conflicts from the commits that landed on main since this branch's merge-base (#721, #732, #734, #735, #722), keeping main's content and re-applying the `min` binary-target rename on top. - justfile: main folded `up` into `dm1` (#722), so the branch's older `up` recipe is dropped rather than resurrected. Main's `dm1` invoked the `{{minimal}}` variable this branch renames, which would have left `just` unable to resolve it; it now invokes `{{min-bin}}`. - CI lanes: keep main's rewritten jobs and steps, renaming only the CLI build flags and built-binary paths (`--bin min`, `target/debug/min`). Also point the sessions example project at `./target/debug/min`; the binary path it documented no longer exists after the rename. Published release asset names (`minimal-linux-amd64`, ...), the macOS `minimal` shim, and the `minimal` crate and lib target are deliberately left alone.
|
Lets kick off an unstable after this also to see if we broke anything in the release |
#1009 split `min completions <shell>` into `completions print` and `completions install`; the release job still called the flat form, so `Generate completions` exited 2 on run 30425725370 and the release never reached GCS or the GitHub Release. Switch the three `min` lines to `completions print <shell>`, and name their outputs after the `min` binary (`min`, `_min`, `min.fish`) rather than the crate: the shim `min` prints registers the command `min`, so a shell only ever autoloads it from a file of that name — the `minimal`/`_minimal` files shipped in `completions.tar.gz` since the binary rename (#737) were dead on arrival. `mip` and `minimald` keep the flat verb; only the `min` CLI changed. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The user-facing command has been
minfor a while — clap says so (#[command(name = "min")]), and the installer lays the binary down asbin/min. But cargo still emittedminimal, andminwas conjured by a rename at release-staging time. The dev build therefore disagreed with what ships:just upgave youtarget/debug/minimalwhile every doc, and every user, typedmin.This declares the binary target explicitly:
Declaring a
[[bin]]disables autodiscovery, sosrc/main.rsnow builds only asmin. Theminimallib target and the package name are unchanged, socargo build -p minimalstill works.Callers updated
--bin minimal→--bin minand the built-binary paths across all five workflows (ci-linux-kvm,ci-linux-native,ci-macos,nightly-tests,release), the KVM lane's testbed staging that copies the CLI ontoPATH,session-e2e.sh'smnl()wrapper, and the justfile's binary variable (minimal→min-bin).What deliberately did NOT change
The published release asset names (
minimal-linux-amd64,minimal-macos-arm64, …). Those are the contract that the install manifest andscripts/install.share built around; renaming them would churn the release channel for no user-visible gain, since the manifest already maps them tobin/min. Only the local build-output path feeding those steps moved, sorelease.ymlnow readsmv target/release/min target/release/minimal-macos-arm64.Two other
minimalnames that are not this binary: the macOS shim (~/.minimal/shim/bin/minimal, a script that runs the CLI inside a VM — it's whatjust artifactsinvokes to materialize the guest kernel), and theminimalcrate/lib target.Verification
Everything that can be run locally, was:
cargo build -p minimalemitstarget/debug/minand no longer emitsminimal;cargo metadataconfirms the targets are[('minimal', lib), ('min', bin)].min --version/--helpwork.E2E_VM=1 ./scripts/session-e2e.sh, which resolvesminfromPATHand autospawnsminvmdexactly as CI does. Cold activate → list → warm call → destroy → stop, all green. This is the same script the Linux native and KVM lanes run, so it exercises thePATH-based resolution those lanes depend on.cargo build --release -p minimal --bin minsucceeds, and theotoolgaterelease.ymlruns against it passes (links only/usr/lib+/System, no libkrun — thedefault-features = falseopt-out still holds).shellcheck scripts/session-e2e.shis clean;just --list/just --evaluate min-binresolve; the installer harness is 148/148 green (itsbin/mincontract is untouched).crates/minimal/tests/cli.rscalls library functions, and only the minvmd tests useCARGO_BIN_EXE_*(forminvmd, unchanged).Follow-up, not done here
docs/reference/cli.mdstill writesminimal run shelletc., andrelease.ymlnames the generated completion filesbash/minimal,zsh/_minimal,fish/minimal.fish. Both are pre-existing inconsistencies — the completion contents already register formin, since clap's command name was alreadymin— and neither affects the build. Worth a separate docs pass.🤖 Generated with Claude Code
Summary by CodeRabbit
mininstead ofminimal.mincommand consistently.min activateandmin ls.