Make the junction crate dependency Windows-only (#3043)

<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

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)]`,


1f626bfc73/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

<!-- How was it tested? -->

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.
This commit is contained in:
Ben Beasley 2024-04-15 17:01:24 -04:00 committed by GitHub
parent f6b1580d8b
commit 2d95ca4b83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"]