fix(launcher): apply cache settings to all uv invocations (#4404)

This commit is contained in:
llama 2025-10-27 20:42:45 +08:00 committed by GitHub
parent 9eb6ec4db8
commit 739e41ce16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -327,7 +327,6 @@ fn handle_version_install_or_update(state: &State, choice: MainMenuChoice) -> Re
} }
command command
.env("UV_CACHE_DIR", &state.uv_cache_dir)
.env("UV_PYTHON_INSTALL_DIR", &state.uv_python_install_dir) .env("UV_PYTHON_INSTALL_DIR", &state.uv_python_install_dir)
.env( .env(
"UV_HTTP_TIMEOUT", "UV_HTTP_TIMEOUT",
@ -346,10 +345,6 @@ fn handle_version_install_or_update(state: &State, choice: MainMenuChoice) -> Re
} }
} }
if state.no_cache_marker.exists() {
command.env("UV_NO_CACHE", "1");
}
match command.ensure_success() { match command.ensure_success() {
Ok(_) => { Ok(_) => {
// Sync succeeded // Sync succeeded
@ -1024,6 +1019,12 @@ fn uv_command(state: &State) -> Result<Command> {
.env("UV_DEFAULT_INDEX", &pypi_mirror); .env("UV_DEFAULT_INDEX", &pypi_mirror);
} }
if state.no_cache_marker.exists() {
command.env("UV_NO_CACHE", "1");
} else {
command.env("UV_CACHE_DIR", &state.uv_cache_dir);
}
// have uv use the system certstore instead of webpki-roots' // have uv use the system certstore instead of webpki-roots'
command.env("UV_NATIVE_TLS", "1"); command.env("UV_NATIVE_TLS", "1");