Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/backend/aqua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,15 @@ impl Backend for AquaBackend {
}
self.install(ctx, &tv, &pkg, &v, &filename)?;

// Clear any cached bin paths so they are recomputed now that installation is complete.
// Without this, a stale cache (e.g. computed before extraction finished) could persist
// and cause the tool's PATH entry to be missing.
self.bin_path_caches.remove(&tv.version);
let cache_path = tv.cache_path().join("bin_paths.msgpack.z");
if cache_path.exists() {
let _ = file::remove_file(&cache_path);
}
Comment on lines +469 to +471

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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(


Ok(tv)
}

Expand Down
Loading