fix(minvmd): look in installed paths for data files & gvproxy - #652
Conversation
📝 WalkthroughWalkthroughThis PR adds a new ChangesImage Path Resolution Rework
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant resolve_or_default
participant data_dir
participant Filesystem
Caller->>resolve_or_default: resolve_kernel_path()
resolve_or_default->>resolve_or_default: check env override
alt override set and non-empty
resolve_or_default-->>Caller: return override path verbatim
else no override
resolve_or_default->>data_dir: compute data directory
alt data_dir unresolved
data_dir-->>Caller: VmError::MissingEnv
else data_dir resolved
resolve_or_default->>Filesystem: check default file exists
alt file exists
Filesystem-->>Caller: return default path
else file missing
Filesystem-->>Caller: VmError::MissingImage
end
end
end
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/minvmd/src/error.rs`:
- Around line 91-96: The MissingImage diagnostic in the Error display path only
reports the variable as “unset”, but resolve_or_default() also treats empty
overrides the same way. Update the formatting for Error::MissingImage so the
message clearly mentions empty values alongside unset ones, keeping the wording
consistent with resolve_or_default() and the existing display implementation in
error.rs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2da0ee46-8c9a-4375-beb6-289f56148e84
📒 Files selected for processing (2)
crates/minvmd/src/error.rscrates/minvmd/src/image.rs
| Self::MissingImage { var, default } => { | ||
| write!( | ||
| f, | ||
| "{var} is unset and no file exists at the default location {}", | ||
| default.display() | ||
| ) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Include empty overrides in the MissingImage diagnostic.
resolve_or_default() treats empty values as unset, but this message only says “unset”, so MINVMD_*="" reports a misleading cause.
Proposed fix
- "{var} is unset and no file exists at the default location {}",
+ "{var} is unset or empty and no file exists at the default location {}",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Self::MissingImage { var, default } => { | |
| write!( | |
| f, | |
| "{var} is unset and no file exists at the default location {}", | |
| default.display() | |
| ) | |
| Self::MissingImage { var, default } => { | |
| write!( | |
| f, | |
| "{var} is unset or empty and no file exists at the default location {}", | |
| default.display() | |
| ) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@crates/minvmd/src/error.rs` around lines 91 - 96, The MissingImage diagnostic
in the Error display path only reports the variable as “unset”, but
resolve_or_default() also treats empty overrides the same way. Update the
formatting for Error::MissingImage so the message clearly mentions empty values
alongside unset ones, keeping the wording consistent with resolve_or_default()
and the existing display implementation in error.rs.
Should fix the issue with the installed
minvmdnot being able to find its requisite files with a default install on MacOSSummary by CodeRabbit
New Features
Bug Fixes