fix(windows&python): Access is denied. (os error 5) (#4969)

This commit is contained in:
pyranota
2024-12-23 15:25:01 +00:00
committed by GitHub
parent 8e45bcb942
commit 9f44aadcf4

View File

@@ -336,6 +336,18 @@ pub async fn uv_pip_compile(
.args(&args)
.stdout(Stdio::piped())
.stderr(Stdio::piped());
#[cfg(windows)]
{
child_cmd
.env("SystemRoot", SYSTEM_ROOT.as_str())
.env("USERPROFILE", crate::USERPROFILE_ENV.as_str())
.env(
"TMP",
std::env::var("TMP").unwrap_or_else(|_| String::from("/tmp")),
);
}
let child_process = start_child_process(child_cmd, uv_cmd).await?;
append_logs(&job_id, &w_id, logs, db).await;
handle_child(