Conversation
…le PATH After installing an aqua tool, clear both the in-memory and disk caches for bin_paths. Without this, a stale cache (computed before the install completed or by a concurrent process) could persist and cause the tool's PATH entry to be missing from the shell environment. Fixes #8372 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the aqua backend by ensuring that the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Greptile SummaryThis PR fixes a cache staleness bug where aqua tool installations could have missing PATH entries. The fix clears both the in-memory Key changes:
How it works: Confidence Score: 5/5
Important Files Changed
Last reviewed commit: dd538d6 |
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where the aqua tool's PATH entry would disappear after upgrading due to a stale cache. The fix involves clearing both the in-memory and on-disk bin_paths cache after an aqua tool install completes. The change appears straightforward and addresses the reported issue. I have added a review comment to suggest a more robust way to handle file removal, including error logging and potential retries.
| if cache_path.exists() { | ||
| let _ = file::remove_file(&cache_path); | ||
| } |
There was a problem hiding this comment.
Instead of directly removing the cache file, consider using a more robust approach that handles potential errors during file removal. For instance, logging the error if the file removal fails can aid in debugging. Additionally, consider retrying the removal a few times with a short delay in case of transient issues.
self.bin_path_caches.remove(&tv.version);
let cache_path = tv.cache_path().join(
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.21 x -- echo |
25.8 ± 1.1 | 24.2 | 37.4 | 1.00 |
mise x -- echo |
26.0 ± 0.8 | 24.5 | 28.6 | 1.01 ± 0.05 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.21 env |
25.5 ± 0.9 | 24.0 | 29.5 | 1.01 ± 0.05 |
mise env |
25.3 ± 0.8 | 23.8 | 28.8 | 1.00 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.21 hook-env |
26.1 ± 0.7 | 24.6 | 28.3 | 1.00 ± 0.05 |
mise hook-env |
26.1 ± 1.0 | 24.6 | 37.7 | 1.00 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.21 ls |
25.3 ± 0.9 | 23.8 | 28.3 | 1.00 |
mise ls |
25.6 ± 0.8 | 24.0 | 28.0 | 1.01 ± 0.05 |
xtasks/test/perf
| Command | mise-2026.2.21 | mise | Variance |
|---|---|---|---|
| install (cached) | 162ms | 162ms | +0% |
| ls (cached) | 92ms | 91ms | +1% |
| bin-paths (cached) | 94ms | 93ms | +1% |
| task-ls (cached) | 854ms | 830ms | +2% |
### 🚀 Features - **(backend-plugin)** pass options to vfox backend plugins by @Attempt3035 in [#8369](#8369) ### 🐛 Bug Fixes - **(install)** prevent --locked mode from modifying or bypassing lockfile by @jdx in [#8362](#8362) - **(install)** clear aqua bin_paths cache after install to prevent stale PATH by @jdx in [#8374](#8374) - **(task)** prevent broken pipe panic and race condition in remote git task cache by @vmaleze in [#8375](#8375) ### 📦️ Dependency Updates - update docker/build-push-action digest to 10e90e3 by @renovate[bot] in [#8367](#8367) - update fedora:43 docker digest to 781b764 by @renovate[bot] in [#8368](#8368) ### 📦 Registry - add porter ([github:getporter/porter](https://github.com/getporter/porter)) by @lbergnehr in [#8380](#8380) - add entire ([aqua:entireio/cli](https://github.com/entireio/cli)) by @TyceHerrman in [#8378](#8378) - add topgrade ([aqua:topgrade-rs/topgrade](https://github.com/topgrade-rs/topgrade)) by @TyceHerrman in [#8377](#8377) ### Chore - remove pre-commit config and tool dependency by @jdx in [#8373](#8373) ### New Contributors - @Attempt3035 made their first contribution in [#8369](#8369) - @lbergnehr made their first contribution in [#8380](#8380)
The aqua backend cached `list_bin_paths` results to `bin_paths.msgpack.z`, but this cache provided negligible performance benefit (reading + decompressing a msgpack file vs reading + parsing a small YAML registry file) while introducing bugs like #8372 where stale cached paths caused missing PATH entries after install. The cache invalidation added in #8374 to address that bug was itself ineffective — it couldn't prevent a concurrent `mise hook-env` process from repopulating the cache during install. Remove the cache entirely along with the now-unused `DashMap` dependency, `PathExt::mount`, and `PathExt::is_empty`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
## Summary - Remove `bin_path_caches` (`DashMap` + `bin_paths.msgpack.z` disk cache) from aqua backend - Remove now-unused `PathExt::mount` and `PathExt::is_empty` - `list_bin_paths` now computes directly every call ## Context The aqua backend cached `list_bin_paths` results to `bin_paths.msgpack.z`, but this cache provided negligible performance benefit — reading + decompressing a msgpack file is comparable to reading + parsing a small YAML registry file (or parsing from the baked-in registry which doesn't even hit disk). Meanwhile, the cache was the root cause of #8372 where stale cached paths caused missing PATH entries after install. The fix attempted in #8374 was ineffective — it cleared the in-memory `DashMap` (only helps same process) and deleted the disk cache (immediately raceable by concurrent `mise hook-env`). The real protection was already in `create_install_dirs()` which wipes `tv.cache_path()` before install begins. Removing the cache entirely eliminates this class of bugs with no meaningful performance impact. ## Test plan - [x] `cargo check` passes with no warnings - [x] All lint checks pass - [ ] Existing e2e tests pass (CI) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes how `list_bin_paths` is computed by removing both in-memory and on-disk caching, which can affect PATH resolution behavior and performance (though intended to reduce stale-path bugs). Scope is limited to the Aqua backend and removal of unused path helpers. > > **Overview** > Removes Aqua’s `bin_paths` caching layer (the per-version `DashMap` and `bin_paths.msgpack.z` file) and stops trying to invalidate it after installs. > > `list_bin_paths` now recomputes binary directories on each call by reading the registry package definition and deriving the paths directly, eliminating stale cached PATH entries. > > Cleans up `PathExt` by deleting the now-unused `mount` and `is_empty` helpers. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5e5c5db. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
bin_pathscache after an aqua tool install completesFixes #8372
Context
The
list_bin_paths()method caches its results tobin_paths.msgpack.z. If this cache gets populated with empty data before the install directory is fully set up (e.g., by a concurrentmise hook-envcall or during shim rebuilding within the samemise useinvocation), the stale empty result persists and the tool's PATH entry disappears.This was reported for
uv0.10.6 on macOS where upgrading caused the PATH entry to vanish, but reinstalling (uninstall + use) fixed it — because uninstalling clears the cache directory.Test plan
mise doctor🤖 Generated with Claude Code
Note
Low Risk
Low risk change limited to aqua install caching: it invalidates in-memory and on-disk
bin_pathscache after install, which may slightly increase post-install bin path recomputation but avoids stale PATH entries.Overview
Prevents missing PATH entries after
aquainstalls by clearinglist_bin_paths()cache state once installation completes.After
install_version_()finishes, it now evicts the in-memorybin_path_cachesentry for the installed version and deletes the on-diskbin_paths.msgpack.zcache file so bin paths are recomputed from the newly-installed files.Written by Cursor Bugbot for commit dd538d6. This will update automatically on new commits. Configure here.