mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Clone individual files on windows ReFS (#3551)
Windows does not support cloning whole directories so clone each file instead. closes #3547 ## Test Plan Ran ` uv pip install setuptools --link-mode=clone` manually
This commit is contained in:
parent
b596b460a8
commit
1218766ea5
1 changed files with 9 additions and 0 deletions
|
@ -327,6 +327,15 @@ fn clone_recursive(
|
|||
|
||||
debug!("Cloning {} to {}", from.display(), to.display());
|
||||
|
||||
if cfg!(windows) && from.is_dir() {
|
||||
// On Windows, reflinking directories is not supported, so we copy each file instead.
|
||||
fs::create_dir_all(&to)?;
|
||||
for entry in fs::read_dir(from)? {
|
||||
clone_recursive(site_packages, wheel, &entry?, attempt)?;
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
match attempt {
|
||||
Attempt::Initial => {
|
||||
if let Err(err) = reflink::reflink(&from, &to) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue