From dd538d6cd778e8b1950a7fa08bcffa96fac91a7f Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:23:52 +0000 Subject: [PATCH] fix(install): clear aqua bin_paths cache after install to prevent stale 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 --- src/backend/aqua.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backend/aqua.rs b/src/backend/aqua.rs index b4e8f5d3f6..c459645b23 100644 --- a/src/backend/aqua.rs +++ b/src/backend/aqua.rs @@ -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); + } + Ok(tv) }