-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(doctor): identify missing/extra shims #1524
Conversation
1fb05b0
to
2fc8e38
Compare
2fc8e38
to
8d98224
Compare
8d98224
to
6db79cb
Compare
|
||
let shims_to_add = shims.difference(&existing_shims); | ||
let shims_to_remove = existing_shims.difference(&shims); | ||
let (shims_to_add, shims_to_remove) = get_shim_diffs(&mise_bin, ts)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was sure this would need to be refactored, but it looks like it wasn't too bad. I actually refactored this at one point to use the set difference and I think that paid off. Before it just did the calculation and symlink edits at the same time.
fn list_tool_bins(t: Arc<dyn Forge>, tv: &ToolVersion) -> Result<Vec<String>> { | ||
Ok(t.list_bin_paths(tv)? | ||
.into_iter() | ||
.par_bridge() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do wonder if using parallelization is actually worth it for stuff like this. I think maybe if someone had like 100 tools (and I know some people do), it might help.
That said, when I have tried to benchmark stuff like this in the past with rust it's basically impossible to tell the difference at least with hyperfine. I think to really find out we'd have to have isolated benchmarks.
also, keep in the back of your mind other potential checks we might be able to add here |
Summary
Closes #1511
These changes enable
mise doctor
to identify missing or extra shims and will request users to runmise reshim
if needed.Additional Notes
checks
rather than a warning, but can be trivially updated to warnings if desired