From 6f8d9b85d8cdd41b03669dda9374f76ab7b2c7e4 Mon Sep 17 00:00:00 2001 From: Jo <10510431+j178@users.noreply.github.com> Date: Wed, 5 Feb 2025 21:54:02 +0800 Subject: [PATCH] Remove `cachedir` dependency (#11240) ## Summary Vendor the `HEADER` constant too so we can eliminate the dependency on `cachedir`. --- Cargo.lock | 10 ---------- Cargo.toml | 1 - crates/uv-fs/Cargo.toml | 1 - crates/uv-fs/src/cachedir.rs | 3 ++- 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 339761448..57567d0dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -473,15 +473,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "cachedir" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4703f3937077db8fa35bee3c8789343c1aec2585f0146f09d658d4ccc0e8d873" -dependencies = [ - "tempfile", -] - [[package]] name = "camino" version = "1.1.9" @@ -5085,7 +5076,6 @@ name = "uv-fs" version = "0.0.1" dependencies = [ "backon", - "cachedir", "dunce", "either", "encoding_rs_io", diff --git a/Cargo.toml b/Cargo.toml index 6b7c6b3e0..91d9c996e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -85,7 +85,6 @@ base64 = { version = "0.22.1" } bitflags = { version = "2.6.0" } boxcar = { version = "0.2.5" } bytecheck = { version = "0.8.0" } -cachedir = { version = "0.3.1" } cargo-util = { version = "0.2.14" } clap = { version = "4.5.17", features = ["derive", "env", "string", "wrap_help"] } clap_complete_command = { version = "0.6.1" } diff --git a/crates/uv-fs/Cargo.toml b/crates/uv-fs/Cargo.toml index 7d6a46d61..f15a1fc6b 100644 --- a/crates/uv-fs/Cargo.toml +++ b/crates/uv-fs/Cargo.toml @@ -16,7 +16,6 @@ doctest = false workspace = true [dependencies] -cachedir = { workspace = true } dunce = { workspace = true } either = { workspace = true } encoding_rs_io = { workspace = true } diff --git a/crates/uv-fs/src/cachedir.rs b/crates/uv-fs/src/cachedir.rs index cb2feb390..196b3dba7 100644 --- a/crates/uv-fs/src/cachedir.rs +++ b/crates/uv-fs/src/cachedir.rs @@ -3,7 +3,8 @@ use std::io::Write; use std::{io, path}; -use cachedir::HEADER; +/// The `CACHEDIR.TAG` file header as defined by the [specification](https://bford.info/cachedir/). +const HEADER: &[u8; 43] = b"Signature: 8a477f597d28d172789f06886806bc55"; /// Adds a tag to the specified `directory`. ///