mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Strip only UV_* env vars
If we don't preserve env vars like TEMP, it results in run failures on Windows: https://forums.ankiweb.net/t/anki-25-08-beta/63645/28
This commit is contained in:
parent
dfbb7302e8
commit
51cf09daf3
2 changed files with 19 additions and 4 deletions
|
@ -32,9 +32,17 @@ pub fn setup_pyenv(args: PyenvArgs) {
|
|||
}
|
||||
}
|
||||
|
||||
let mut command = Command::new(args.uv_bin);
|
||||
|
||||
// remove UV_* environment variables to avoid interference
|
||||
for (key, _) in std::env::vars() {
|
||||
if key.starts_with("UV_") {
|
||||
command.env_remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
run_command(
|
||||
Command::new(args.uv_bin)
|
||||
.env_clear()
|
||||
command
|
||||
.env("UV_PROJECT_ENVIRONMENT", args.pyenv_folder.clone())
|
||||
.args(["sync", "--locked", "--no-config"])
|
||||
.args(args.extra_args),
|
||||
|
|
|
@ -257,9 +257,16 @@ fn handle_version_install_or_update(state: &State, choice: MainMenuChoice) -> Re
|
|||
|
||||
// Prepare to sync the venv
|
||||
let mut command = Command::new(&state.uv_path);
|
||||
command.current_dir(&state.uv_install_root);
|
||||
|
||||
// remove UV_* environment variables to avoid interference
|
||||
for (key, _) in std::env::vars() {
|
||||
if key.starts_with("UV_") {
|
||||
command.env_remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
command
|
||||
.current_dir(&state.uv_install_root)
|
||||
.env_clear()
|
||||
.env("UV_CACHE_DIR", &state.uv_cache_dir)
|
||||
.env("UV_PYTHON_INSTALL_DIR", &state.uv_python_install_dir)
|
||||
.args(["sync", "--upgrade", "--managed-python", "--no-config"]);
|
||||
|
|
Loading…
Reference in a new issue