Repository navigation
Conversation
…(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>
Contributor
Security scan found no critical or high findings on lines changed by this pull requestView 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. |
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.
Why
When
rocmruns from a cargotarget/debugortarget/releasefolder,rocm uninstallkeeps that folder's binaries, and--force-dev-binarieswas 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 folderrocmruns from are ever planned.What changes
rocm uninstall --allow-dev-binariesis the new name.--force-dev-binariesstill works as a hidden alias: it is not shown in--helpand not offered by shell completions.target/debugortarget/releasefolderrocmruns from) and that it overrides nothing else:--keep-binaries,--dry-runand the confirmation still apply. Behaviour is unchanged; this states it.Left alone:names--allow-dev-binariesand says it removes "the ROCm CLI binaries in that folder" instead of "sibling debug/release binaries".A hidden alias is still a clap "did you mean" candidate, so the existing hidden
--forceguard stays: without it, a mistyped--forcewould still be answered with--force-dev-binaries. The--forcetest 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_advertisedparses both spellings to the same option, checks it is off by default, and checks that--helpand the generated bash completions carry only the new name.uninstall_plan::tests::a_development_build_keeps_its_binaries_unless_allowedbuilds atarget/debugfolder and asserts the plan together with its message: without the flag nothing is planned and the skip note names--allow-dev-binaries; with it exactlyrocmandrocmdare planned and nothing else in the folder; with--keep-binariesas well, nothing is planned.cli::tests::a_mistyped_force_never_reaches_the_dev_binaries_flagis extended: no--forcenear miss is answered with either spelling, while a misspelling of either spelling is still answered with that spelling.@id:uninstall-development-build-keeps-its-binaries-unless-allowed(uninstall-16) runs a copy of the real binary from atarget/debugfolder: a dry run keeps the binaries and names the flag, the older spelling lists them, allowing them without--yesoutside a terminal is refused and leaves them in place, and with--yesthey are removed. It is@requires-os:linuxbecause Windows deletes the runningrocm.exeonly after the command exits; it runs in theE2E testsjob (both Ubuntu images). On Windows the plan is covered by the unit test above, which runs in theWindows build and test (debug)job.&& !options.allow_dev_binariesturns the plan unit test and uninstall-16 red; removing the alias turns theclitests and uninstall-16 red.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-targetshas three failures that fail identically on the base commit and come from the test host's configuration (twobuild_metadatagit-watch-path tests, which inherit a global commit-signing setting, andservice_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 smokestops at therocmdsandbox step, which needs unprivileged user namespaces that the host does not allow; unrelated to uninstall.Overlap with open PRs
#569 and #299 also touch
rocm uninstall. #569 adds two places that recognise--force-dev-binariesby name and numbers its new scenarios from uninstall-16; #299 setsforce_dev_binariesinUninstallOptionstest literals. Whichever lands second needs a mechanical rename toallow_dev_binaries/--allow-dev-binariesand, for #569, renumbered scenarios.Checklist
tests/e2e-cucumber/expectations.tomlfor the fixed ticket ID and removed/narrowed any now-stale xfail rows. (Not a bug fix; no xfail row names ROCMAI-64.)docs/architecture.md(the clap declaration incli.rsand the dispatch wiring inmain.rs/lib.rsare expected, not a violation). (No new subcommand.).rsfile underxtask/srcortests/e2e-cucumber),docs/architecture.mdhas the matching entry (cargo xtask check-architecture-docfails 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.)--keep-binariesand no---yescases.)