fix(install): resolve repo_version placeholder in driver dry-run output - #307
Open
r0x0r wants to merge 1 commit into
Open
fix(install): resolve repo_version placeholder in driver dry-run output#307r0x0r wants to merge 1 commit into
r0x0r wants to merge 1 commit into
Conversation
The driver install plan stores the repo version as a shell parameter-
expansion template (${ROCM_CLI_AMDGPU_VERSION:-7.2.4}) so it can be
embedded verbatim into the shell commands that will later expand it. The
human-readable plan summary printed the same template on its
"repo_version:" line, leaking an unexpanded shell placeholder into
user-facing dry-run output.
Resolve the template to its effective value for display only: the value
of ROCM_CLI_AMDGPU_VERSION when set and non-empty (matching shell :-
semantics), otherwise the 7.2.4 default. The executable commands still
carry the literal template so the runtime shell resolves it.
Add unit tests for the resolver (default, env override, empty-as-unset,
non-template pass-through) and a render-level regression test asserting
the dry-run summary shows the resolved version rather than the raw
placeholder.
Signed-off-by: Roman Sirokov <roman.sirokov@amd.com>
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.
Summary
rocm install driver --dry-runprinted an unexpanded shell-style placeholder on therepo_version:line:The literal
${ROCM_CLI_AMDGPU_VERSION:-7.2.4}template was emitted verbatim instead of being resolved to the effective version.Root cause
The driver install plan stores the repo version as a shell parameter-expansion template so it can be embedded verbatim into the shell commands that later expand it at runtime. The human-readable plan summary printed the same template on its
repo_version:line, leaking the raw shell placeholder into user-facing output.Fix
Resolve the template to its effective value for display only:
ROCM_CLI_AMDGPU_VERSIONwhen set and non-empty (matching shell:-semantics), otherwise the7.2.4default.The executable commands still carry the literal template, so the runtime shell resolves it as before — only the summary line changes.
Before:
After (env unset):
Tests
Added:
resolve_repo_version_uses_default_when_env_unsetresolve_repo_version_prefers_env_value_when_setresolve_repo_version_treats_empty_env_as_unsetresolve_repo_version_passes_through_non_templatedriver_plan_dry_run_repo_version_line_is_resolved— render-level regression asserting the dry-run summary shows the resolved version and not the raw placeholder.The regression test fails before the fix (summary line showed the raw placeholder) and passes after.
Verification
cargo fmt -p rocmcargo clippy -p rocm --all-targets -- -D warningscargo test -p rocm --bin rocm driver_plan(20 passed) and the new resolver testsThis is a cosmetic/clarity change to dry-run output; no behavior change to the executed commands.