From 2d95ca4b832832ddf8890b34834c1dfdf8e22376 Mon Sep 17 00:00:00 2001 From: Ben Beasley Date: Mon, 15 Apr 2024 17:01:24 -0400 Subject: [PATCH] Make the junction crate dependency Windows-only (#3043) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Since the [`junction` crate](https://crates.io/crates/junction) implements Windows-only functionality, and since the only place it is used is guarded by `#[cfg(windows)]`, https://github.com/astral-sh/uv/blob/1f626bfc7300a700257348e1890af90837c740e6/crates/uv-fs/src/lib.rs#L65-L86 it makes sense not to depend on this crate at all on non-Windows platforms. If nothing else, this makes Linux distribution packagers’ lives just a *tiny* bit easier. ## Test Plan On Fedora Linux 39: ``` # To avoid an error when /tmp and the working directory are on different filesystems: $ mkdir _tmp $ TMPDIR="${PWD}/tmp" cargo run -p uv-dev -- fetch-python $ cargo test ``` I don’t have access to a Windows system. --- crates/uv-fs/Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/uv-fs/Cargo.toml b/crates/uv-fs/Cargo.toml index 208558ed8..393b8771b 100644 --- a/crates/uv-fs/Cargo.toml +++ b/crates/uv-fs/Cargo.toml @@ -20,7 +20,6 @@ dunce = { workspace = true } encoding_rs_io = { workspace = true } fs-err = { workspace = true } fs2 = { workspace = true } -junction = { workspace = true } once_cell = { workspace = true } path-absolutize = { workspace = true } tempfile = { workspace = true } @@ -28,6 +27,9 @@ tokio = { workspace = true, optional = true } tracing = { workspace = true } urlencoding = { workspace = true } +[target.'cfg(windows)'.dependencies] +junction = { workspace = true } + [features] default = [] tokio = ["dep:tokio", "fs-err/tokio", "backoff/tokio"]