Skip to content

Commit c465076

Browse files
jgodlewbpronan
andauthored
Merging Cargo.toml dependencies into workspace Cargo.toml (#339)
Co-authored-by: Brian Ronan <brian.ronan@huggingface.co>
1 parent 4faec0b commit c465076

File tree

31 files changed

+1887
-2110
lines changed

31 files changed

+1887
-2110
lines changed

Cargo.lock

Lines changed: 696 additions & 796 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 82 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ members = [
55
"cas_client",
66
"cas_object",
77
"cas_types",
8+
"chunk_cache",
89
"data",
10+
"deduplication",
911
"error_printer",
1012
"file_utils",
11-
"merklehash",
1213
"mdb_shard",
14+
"merklehash",
1315
"parutils",
16+
"progress_tracking",
1417
"utils",
15-
"cas_object",
16-
"cas_types",
17-
"chunk_cache",
18-
"xet_threadpool",
19-
"deduplication", "progress_tracking"]
18+
"xet_threadpool"
19+
]
2020

21-
exclude = ["hf_xet", "chunk_cache_bench", "wasm_xet"]
21+
exclude = ["chunk_cache_bench", "hf_xet", "wasm_xet"]
2222

2323
[profile.release]
2424
opt-level = 3
@@ -29,3 +29,78 @@ debug = 1
2929
inherits = "dev"
3030
opt-level = 3
3131
debug = 1
32+
33+
[workspace.dependencies]
34+
anyhow = "1"
35+
async-scoped = { version = "0.7", features = ["use-tokio"] }
36+
async-trait = "0.1"
37+
base64 = "0.22"
38+
bincode = "1.3"
39+
bitflags = { version = "2.9", features = ["serde"] }
40+
blake3 = "1.5"
41+
bytes = "1.8"
42+
chrono = "0.4"
43+
clap = { version = "4", features = ["derive"] }
44+
colored = "2"
45+
countio = { version = "0.2", features = ["futures"] }
46+
crc32fast = "1.4"
47+
csv = "1"
48+
ctor = "0.4"
49+
dirs = "5.0"
50+
futures = "0.3"
51+
futures-io = "0.3"
52+
futures-util = "0.3"
53+
gearhash = "0.1"
54+
getrandom = "0.3"
55+
half = "2.4"
56+
heed = "0.11"
57+
http = "1"
58+
itertools = "0.14"
59+
jsonwebtoken = "9.3"
60+
lazy_static = "1.5"
61+
len-trait = "0.6"
62+
libc = "0.2"
63+
lz4_flex = "0.11"
64+
mockall = "0.13"
65+
more-asserts = "0.3"
66+
once_cell = "1.20"
67+
openssl = "0.10"
68+
parking_lot = "0.12"
69+
pin-project = "1"
70+
prometheus = "0.14"
71+
rand = "0.9"
72+
rand_chacha = "0.9"
73+
rayon = "1.5"
74+
regex = "1"
75+
reqwest = { version = "0.12", features = ["json", "stream"] }
76+
reqwest-middleware = "0.4"
77+
reqwest-retry = "0.7"
78+
rustc-hash = "1.1"
79+
safe-transmute = "0.11"
80+
serde = { version = "1", features = ["derive"] }
81+
serde_json = "1"
82+
serde_repr = "0.1"
83+
sha2 = "0.10"
84+
static_assertions = "1.1"
85+
tempfile = "3.20"
86+
thiserror = "2.0"
87+
tokio = { version = "1.44", features = ["sync"] }
88+
tokio-retry = "0.3"
89+
tokio-util = { version = "0.7", features = ["io"] }
90+
tracing = "0.1"
91+
ulid = "1.2"
92+
uuid = "1"
93+
url = "2.5"
94+
walkdir = "2"
95+
whoami = "1"
96+
97+
# windows
98+
winapi = { version = "0.3", features = ["winerror", "winnt", "handleapi", "processthreadsapi", "securitybaseapi"] }
99+
100+
# dev-deps
101+
criterion = { version = "0.5", features = ["html_reports"] }
102+
httpmock = "0.7"
103+
serial_test = "3"
104+
tempdir = "0.3"
105+
tracing-test = { version = "0.2", features = ["no-env-filter"] }
106+
wiremock = "0.6"

cas_client/Cargo.toml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,41 @@ edition = "2021"
55

66
[features]
77
strict = []
8-
98
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
109

1110
[dependencies]
12-
cas_types = { version = "0.1.0", path = "../cas_types" }
1311
cas_object = { path = "../cas_object" }
12+
cas_types = { path = "../cas_types" }
1413
chunk_cache = { path = "../chunk_cache" }
14+
deduplication = { path = "../deduplication" }
1515
error_printer = { path = "../error_printer" }
1616
file_utils = { path = "../file_utils" }
17-
utils = { path = "../utils" }
18-
merkledb = { path = "../merkledb" }
1917
mdb_shard = { path = "../mdb_shard" }
18+
merkledb = { path = "../merkledb" }
2019
merklehash = { path = "../merklehash" }
21-
xet_threadpool = { path = "../xet_threadpool" }
22-
deduplication = { path = "../deduplication" }
2320
progress_tracking = { path = "../progress_tracking" }
24-
thiserror = "2.0"
25-
tokio = { version = "1.44", features = ["sync"] }
26-
async-trait = "0.1.9"
27-
anyhow = "1"
28-
http = "1.1.0"
29-
tempfile = "3.13.0"
30-
tracing = "0.1.41"
31-
bytes = "1"
32-
itertools = "0.10"
33-
reqwest = { version = "0.12.7", features = ["json", "stream"] }
34-
reqwest-middleware = "0.3.3"
35-
url = "2.5.2"
36-
reqwest-retry = "0.6.1"
37-
heed = "0.11"
38-
futures = "0.3.31"
39-
derivative = "2.2.0"
40-
more-asserts = "0.3.1"
41-
tokio-retry = "0.3.0"
21+
utils = { path = "../utils" }
22+
xet_threadpool = { path = "../xet_threadpool" }
23+
24+
anyhow = { workspace = true }
25+
async-trait = { workspace = true }
26+
bytes = { workspace = true }
27+
futures = { workspace = true }
28+
heed = { workspace = true }
29+
http = { workspace = true }
30+
more-asserts = { workspace = true }
31+
reqwest = { workspace = true }
32+
reqwest-middleware = { workspace = true }
33+
reqwest-retry = { workspace = true }
34+
tempfile = { workspace = true }
35+
thiserror = { workspace = true }
36+
tokio = { workspace = true }
37+
tokio-retry = { workspace = true }
38+
tracing = { workspace = true }
39+
url = { workspace = true }
4240

4341
[dev-dependencies]
44-
rand = "0.8.5"
45-
httpmock = "0.7.0"
46-
wiremock = "0.6"
47-
tracing-test = { version = "0.2.5", features = ["no-env-filter"] }
42+
httpmock = { workspace = true }
43+
rand = { workspace = true }
44+
tracing-test = { workspace = true }
45+
wiremock = { workspace = true }

cas_client/src/download_utils.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::collections::HashMap;
2+
use std::fmt;
23
use std::sync::{Arc, Mutex, RwLock};
34
use std::time::{Duration, Instant};
45

56
use cas_object::error::CasObjectError;
67
use cas_types::{CASReconstructionFetchInfo, CASReconstructionTerm, ChunkRange, FileRange, HexMerkleHash, Key};
78
use chunk_cache::ChunkCache;
89
use deduplication::constants::MAX_XORB_BYTES;
9-
use derivative::Derivative;
1010
use error_printer::ErrorPrinter;
1111
use futures::TryStreamExt;
1212
use http::header::RANGE;
@@ -137,21 +137,32 @@ impl FetchInfo {
137137

138138
/// Helper object containing the structs needed when downloading a term in parallel
139139
/// during reconstruction.
140-
#[derive(Derivative)]
141-
#[derivative(Debug)]
142140
pub(crate) struct TermDownload {
143141
pub term: CASReconstructionTerm,
144142
pub skip_bytes: u64, // number of bytes to skip at the front
145143
pub take: u64, // number of bytes to take after skipping bytes,
146144
// effectively taking [skip_bytes..skip_bytes+take]
147145
// out of the downloaded range
148146
pub fetch_info: Arc<FetchInfo>, // utility to get URL to download this term
149-
#[derivative(Debug = "ignore")]
150147
pub chunk_cache: Option<Arc<dyn ChunkCache>>,
151148
pub client: Arc<ClientWithMiddleware>, // only used for downloading range
152149
pub range_download_single_flight: RangeDownloadSingleFlight,
153150
}
154151

152+
impl fmt::Debug for TermDownload {
153+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
154+
// print out everything except the chunk cache
155+
f.debug_struct("TermDownload")
156+
.field("term", &self.term)
157+
.field("skip_bytes", &self.skip_bytes)
158+
.field("take", &self.take)
159+
.field("fetch_info", &self.fetch_info)
160+
.field("client", &self.client)
161+
.field("range_download_single_flight", &self.range_download_single_flight)
162+
.finish()
163+
}
164+
}
165+
155166
#[derive(Debug)]
156167
pub(crate) struct TermDownloadResult<T> {
157168
pub data: T, // download result

cas_object/Cargo.toml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,30 @@ harness = false
1414
bench = true
1515

1616
[dependencies]
17-
thiserror = "2.0"
17+
deduplication = { path = "../deduplication" }
1818
error_printer = { path = "../error_printer" }
19+
mdb_shard = { path = "../mdb_shard" }
1920
merkledb = { path = "../merkledb" }
2021
merklehash = { path = "../merklehash" }
21-
mdb_shard = { path = "../mdb_shard" }
2222
utils = { path = "../utils" }
23-
parutils = { path = "../parutils" }
24-
deduplication = { path = "../deduplication" }
25-
anyhow = "1.0.88"
26-
tracing = "0.1.40"
27-
lz4_flex = "0.11.3"
28-
bytes = "1.7.2"
29-
rand = "0.9"
30-
blake3 = "1.5.4"
31-
futures = { version = "0.3.31" }
32-
tokio = { version = "1.44", features = ["sync", "time", "rt", "macros"] }
33-
half = "2.4.1"
34-
serde = { version = "1.0.129", features = ["derive"] }
35-
countio = { version = "0.2.19", features = ["futures"] }
36-
clap = { version = "4.1", features = ["derive"] }
37-
csv = "1.1"
38-
more-asserts = "0.3.1"
23+
24+
anyhow = { workspace = true }
25+
blake3 = { workspace = true }
26+
bytes = { workspace = true }
27+
clap = { workspace = true }
28+
countio = { workspace = true }
29+
csv = { workspace = true }
30+
futures = { workspace = true }
31+
half = { workspace = true }
32+
lz4_flex = { workspace = true }
33+
rand = { workspace = true }
34+
serde = { workspace = true }
35+
thiserror = { workspace = true }
36+
tokio = { workspace = true, features = ["time", "rt", "macros"] }
37+
tracing = { workspace = true }
3938

4039
[target.'cfg(not(target_family = "wasm"))'.dependencies]
41-
tokio-util = { version = "0.7.12", features = ["io"] }
40+
tokio-util = { workspace = true }
4241

4342
[[bin]]
4443
path = "src/byte_grouping/compression_stats/collect_compression_stats.rs"

cas_types/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
merklehash = { path = "../merklehash" }
8-
thiserror = "2.0"
9-
serde = { version = "1.0.208", features = ["derive"] }
10-
serde_repr = "0.1.19"
11-
derivative = "2.2.0"
8+
9+
serde = { workspace = true }
10+
serde_repr = { workspace = true }
11+
thiserror = { workspace = true }

cas_types/src/lib.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::collections::{HashMap, HashSet};
44
use std::marker::PhantomData;
55
use std::str::FromStr;
66

7-
use derivative::Derivative;
87
use merklehash::MerkleHash;
98
use serde::{Deserialize, Serialize};
109
use serde_repr::{Deserialize_repr, Serialize_repr};
@@ -98,16 +97,26 @@ impl From<FileRange> for HttpRange {
9897
}
9998

10099
// note that the standard PartialOrd/Ord impls will first check `start` then `end`
101-
#[derive(Derivative, Serialize, Deserialize, Clone, Eq, PartialEq, PartialOrd, Ord, Default, Hash)]
102-
#[derivative(Debug)]
100+
#[derive(Serialize, Deserialize, Clone, Eq, PartialEq, PartialOrd, Ord, Default, Hash)]
103101
pub struct Range<Idx, Kind> {
104102
pub start: Idx,
105103
pub end: Idx,
106104
#[serde(skip)]
107-
#[derivative(Debug = "ignore")]
108105
pub _marker: PhantomData<Kind>,
109106
}
110107

108+
impl<Idx, _C> fmt::Debug for Range<Idx, _C>
109+
where
110+
Idx: fmt::Debug,
111+
{
112+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
113+
f.debug_struct("Range")
114+
.field("start", &self.start)
115+
.field("end", &self.end)
116+
.finish()
117+
}
118+
}
119+
111120
impl<Idx, Kind> Range<Idx, Kind> {
112121
pub fn new(start: Idx, end: Idx) -> Self {
113122
Self {

chunk_cache/Cargo.toml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,30 @@ edition = "2021"
55

66
[dependencies]
77
cas_types = { path = "../cas_types" }
8-
merklehash = { path = "../merklehash" }
9-
thiserror = "2.0"
108
error_printer = { path = "../error_printer" }
119
file_utils = { path = "../file_utils" }
10+
merklehash = { path = "../merklehash" }
1211
utils = { path = "../utils" }
13-
base64 = "0.22.1"
14-
tracing = "0.1.40"
15-
rand = "0.8.5"
16-
mockall = "0.13.0"
17-
clap = { version = "4.5.20", optional = true, features = ["derive"] }
18-
once_cell = "1.20.2"
19-
crc32fast = "1.4.2"
20-
log = "0.4.22"
21-
async-trait = "0.1.88"
22-
tokio = { version = "1.44", features = ["sync"] }
12+
13+
async-trait = { workspace = true }
14+
base64 = { workspace = true }
15+
clap = { workspace = true, optional = true }
16+
crc32fast = { workspace = true }
17+
mockall = { workspace = true }
18+
once_cell = { workspace = true }
19+
rand = { workspace = true }
20+
thiserror = { workspace = true }
21+
tokio = { workspace = true }
22+
tracing = { workspace = true }
2323

2424
[dev-dependencies]
25-
tokio = { version = "1.44", features = ["full"] }
26-
tempdir = "0.3.7"
25+
tempdir = { workspace = true }
26+
tokio = { workspace = true, features = ["full"] }
2727

2828
[[bin]]
2929
name = "cache_analysis"
3030
path = "./src/bin/analysis.rs"
3131
required-features = ["analysis"]
3232

33-
3433
[features]
3534
analysis = ["dep:clap"]

chunk_cache/src/disk.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl CacheState {
113113
error!("cache random_item for eviction: no items in cache");
114114
return None;
115115
}
116-
let random_item = rand::random::<usize>() % self.num_items;
116+
let random_item = rand::random::<u32>() as usize % self.num_items;
117117
let mut count = 0;
118118
for (key, items) in self.inner.iter() {
119119
if random_item < count + items.len() {
@@ -1003,7 +1003,7 @@ mod tests {
10031003

10041004
// not matching
10051005
let (_cache_root, cache, key, range, mut offsets, data) = setup().await;
1006-
offsets[1] = offsets[1] + 1;
1006+
offsets[1] += 1;
10071007
assert!(cache.put(&key, &range, &offsets, &data).await.is_err());
10081008

10091009
// bad data
@@ -1013,7 +1013,7 @@ mod tests {
10131013

10141014
// data changed
10151015
let (_cache_root, cache, key, range, offsets, mut data) = setup().await;
1016-
data[0] = data[0] + 1;
1016+
data[0] += 1;
10171017
assert!(cache.put(&key, &range, &offsets, &data).await.is_err());
10181018
}
10191019

0 commit comments

Comments
 (0)