Skip to content

Commit c43a375

Browse files
committed
fix(uv-ffi): use USERPROFILE/temp_dir fallback on Windows instead of /tmp/uv
HOME is not set on Windows CI runners — falling through to hardcoded /tmp/uv which doesn't exist, causing interpreter query panic at lib.rs:49. Now checks USERPROFILE, LOCALAPPDATA, then std::env::temp_dir().
1 parent 735bff0 commit c43a375

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

crates/uv-ffi/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ fn get_engine(python_exe: &str) -> &'static UvEngine {
4141
.unwrap_or_else(|_| {
4242
std::env::var("HOME")
4343
.map(|h| std::path::PathBuf::from(h).join(".cache").join("uv"))
44-
.unwrap_or_else(|_| std::path::PathBuf::from("/tmp/uv"))
44+
.unwrap_or_else(|_| {
45+
std::env::var("USERPROFILE")
46+
.or_else(|_| std::env::var("LOCALAPPDATA"))
47+
.map(|p| std::path::PathBuf::from(p).join(".cache").join("uv"))
48+
.unwrap_or_else(|_| std::env::temp_dir().join("uv"))
49+
})
4550
});
4651
let cache = Cache::from_path(cache_dir);
4752

0 commit comments

Comments
 (0)