Repository navigation
fix(minimal): compile the spin demo only in debug builds - #2301
Merged
Merged
Conversation
clap draws typo-suggestion candidates from every subcommand, hidden ones included, so release builds of min suggested the hidden spin development demo on subcommand typos (e.g. min sesion listed spin ahead of the real session/session candidates). Gate the Spin command, its args struct, the dispatch arm, and the cmd_spin handler behind cfg(debug_assertions) — the same treatment the debug-answerer-command dev aid already gets — and add a release-only test asserting the subcommand is absent from the CLI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Member
|
/review |
Contributor
|
Approved: no findings at Nothing to do. Clobber: none: |
norrietaylor
approved these changes
Oct 18, 2026
Member
There was a problem hiding this comment.
Approved on ARCH PASS at 6f826f1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABX3vWsQ
Release builds of
minsuggested the hiddenspindevelopment demo in clap's typo tips:min sesionprintedtip: some similar subcommands exist: 'spin', 'version', 'sessions', 'session',advertising an undocumented command ahead of the intended
session.clap draws suggestion candidates from every subcommand, hidden ones included, so hiding alone
cannot keep a dev-only command out of release output. This compiles the
Spinvariant, itsargs struct, the dispatch arm, and the
cmd_spinhandler only under#[cfg(debug_assertions)],matching the existing
debug-answerer-commanddev aid, and adds a release-only test assertingthe subcommand is absent from the CLI.
Verification
cargo fmt --all --check— cleancargo clippy --workspace --all-targets --locked -- -D warnings— cleancargo test --locked -p minimal— 523 passed; 1 failure (legacy_network_spellings_parse_with_hint) is pre-existing and fails identically on the unmodified treecargo test --release --locked -p minimal spin_absent_in_release— 1 passedmin sesion: before, the tip listed'spin', 'version', 'sessions', 'session'; after,'version', 'sessions', 'session'min sesionstill namesspin, andmin spin --seconds 1still runs — the dev aid is intactSummary by CodeRabbit
spincommand is now available only in debug builds and is omitted from release builds.