Skip to content

feat(uninstall): rename --force-dev-binaries to --allow-dev-binaries (ROCMAI-64) - #1100

Draft
rominf wants to merge 1 commit into
mainfrom
ROCMAI-64-feat-allow-dev-binaries
Draft

rominf wants to merge 1 commit into
mainfrom
ROCMAI-64-feat-allow-dev-binaries

Conversation

@rominf

@rominf rominf commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Why

When rocm runs from a cargo target/debug or target/release folder, rocm uninstall keeps that folder's binaries, and --force-dev-binaries was the opt-in to remove them. The name reads like a general "force": it suggests the flag skips confirmation or overrides --keep-binaries, when all it does is lift the one development-build exception. Its help ("Allow removing development binaries inside the current build tree") did not say what it removes, and the skip message offered it "to remove sibling debug/release binaries", although only the ROCm CLI binaries in the folder rocm runs from are ever planned.

What changes

  • rocm uninstall --allow-dev-binaries is the new name. --force-dev-binaries still works as a hidden alias: it is not shown in --help and not offered by shell completions.
  • The help says what the flag removes (the ROCm CLI binaries in the target/debug or target/release folder rocm runs from) and that it overrides nothing else: --keep-binaries, --dry-run and the confirmation still apply. Behaviour is unchanged; this states it.
  • The dev-build skip message under Left alone: names --allow-dev-binaries and says it removes "the ROCm CLI binaries in that folder" instead of "sibling debug/release binaries".
  • README.md, docs/testing.md and docs/manual-testing.md describe the new name, the alias, and what the flag does and does not override.

A hidden alias is still a clap "did you mean" candidate, so the existing hidden --force guard stays: without it, a mistyped --force would still be answered with --force-dev-binaries. The --force test now asserts that neither spelling is suggested.

Non-goal: which builds count as development builds, and which files are removed from one, are unchanged.

Verification

  • cli::tests::both_spellings_allow_dev_binaries_and_only_the_new_one_is_advertised parses both spellings to the same option, checks it is off by default, and checks that --help and the generated bash completions carry only the new name.
  • uninstall_plan::tests::a_development_build_keeps_its_binaries_unless_allowed builds a target/debug folder and asserts the plan together with its message: without the flag nothing is planned and the skip note names --allow-dev-binaries; with it exactly rocm and rocmd are planned and nothing else in the folder; with --keep-binaries as well, nothing is planned.
  • cli::tests::a_mistyped_force_never_reaches_the_dev_binaries_flag is extended: no --force near miss is answered with either spelling, while a misspelling of either spelling is still answered with that spelling.
  • New scenario @id:uninstall-development-build-keeps-its-binaries-unless-allowed (uninstall-16) runs a copy of the real binary from a target/debug folder: a dry run keeps the binaries and names the flag, the older spelling lists them, allowing them without --yes outside a terminal is refused and leaves them in place, and with --yes they are removed. It is @requires-os:linux because Windows deletes the running rocm.exe only after the command exits; it runs in the E2E tests job (both Ubuntu images). On Windows the plan is covered by the unit test above, which runs in the Windows build and test (debug) job.
  • Break-to-red: removing && !options.allow_dev_binaries turns the plan unit test and uninstall-16 red; removing the alias turns the cli tests and uninstall-16 red.
  • Run locally on Linux and passing: cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --check, cargo xtask check-module-size, cargo xtask check-architecture-doc, the 16 uninstall e2e scenarios, and the feature-naming check.

Not verified locally:

  • cargo test --workspace --all-targets has three failures that fail identically on the base commit and come from the test host's configuration (two build_metadata git-watch-path tests, which inherit a global commit-signing setting, and service_control::tests::stop_of_a_container_engine_is_unconfirmed_when_the_engine_stop_fails, whose container-engine stand-in is bypassed there). None touches uninstall.
  • cargo xtask smoke stops at the rocmd sandbox step, which needs unprivileged user namespaces that the host does not allow; unrelated to uninstall.
  • Nothing was run on Windows.

Overlap with open PRs

#569 and #299 also touch rocm uninstall. #569 adds two places that recognise --force-dev-binaries by name and numbers its new scenarios from uninstall-16; #299 sets force_dev_binaries in UninstallOptions test literals. Whichever lands second needs a mechanical rename to allow_dev_binaries / --allow-dev-binaries and, for #569, renumbered scenarios.

Checklist

  • If this PR fixes a bug, searched tests/e2e-cucumber/expectations.toml for the fixed ticket ID and removed/narrowed any now-stale xfail rows. (Not a bug fix; no xfail row names ROCMAI-64.)
  • If this PR adds a new subcommand or subsystem, its domain implementation lives in its own file per docs/architecture.md (the clap declaration in cli.rs and the dispatch wiring in main.rs/lib.rs are expected, not a violation). (No new subcommand.)
  • If this PR adds, renames or removes a production source file (or a .rs file under xtask/src or tests/e2e-cucumber), docs/architecture.md has the matching entry (cargo xtask check-architecture-doc fails otherwise), and the prose of any entry whose file changed role still describes it, which the check cannot verify. (No file added, renamed or removed.)
  • Every new or changed user-facing message was read against the code path that runs after it, and its test asserts the resulting state — not only the wording — per AGENTS.md §3. Covers claims of an outcome, remediation advice naming a command, and promises that something will not happen. (The skip message's advice is asserted with an empty plan, and the flag it names is shown to plan the binaries in the unit test and to remove them in uninstall-16; "overrides nothing else" is asserted by the --keep-binaries and no---yes cases.)

…(ROCMAI-64)

When rocm runs from a cargo target/debug or target/release folder,
uninstall keeps that folder's binaries unless the user opts in. The
opt-in was spelled --force-dev-binaries, which reads as if it forced
past other safeguards; it does not. It overrides nothing else:
--keep-binaries still keeps the binaries, --dry-run still removes
nothing, and the run still needs --yes or a confirmation. The new name,
--allow-dev-binaries, says what it does. The old spelling stays as a
hidden alias so existing scripts keep working, and is left out of the
help and the shell completions.

The dev-build skip message said the flag removes "sibling debug/release
binaries", and the help said "development binaries inside the current
build tree". Only the ROCm CLI binaries in the folder rocm runs from are
removed, so both now say that.

Unit tests pin that both spellings parse to the same option, that only
the new name is advertised, and the dev-build plan with and without the
flag and with --keep-binaries. The --force near-miss guard now checks
that neither spelling is suggested. Scenario uninstall-16 (Linux) runs a
copy of the binary from a target/debug folder and checks the kept,
listed, refused-without-confirmation and removed outcomes.

Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
@github-actions

Copy link
Copy Markdown
Contributor
Security scan found no critical or high findings on lines changed by this pull request

View the security scan run for complete reports.

“New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta.

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