From 24291a4484514d2bbe30462816a94a994f8dbb42 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Tue, 17 Nov 2026 15:58:50 +0100 Subject: [PATCH] refactor: remove unused dependencies and simplify logic Remove obsolete dependencies across multiple crates to clean up the build graph and update `obikdump` to use `try_update`. Add dev-dependencies for tracing in `obiread` and clarify memoization logic in `obiksession`. - Remove `obifastwrite`, `tracing`, `obidebruinj`, `obikentropy`, `obipipeline`, `obidex`, and `obiskbuilder` from `Cargo.lock`. - Remove `obifastwrite` and `tracing` dependencies from `src/obidebruinj/Cargo.toml`. - Update `dump` function in `src/obikdump/src/dump.rs` to use `try_update` instead of `fetch_update` for updating remaining counts. - Remove `obitaxonomy`, `obidebruinj`, `obipipeline`, and `obikentropy` dependencies from `src/obikindex/Cargo.toml`. - Remove `obiksession` dependency from `src/obikmer/Cargo.toml`. - Remove `obiskbuilder` dependency from `src/obikphylo/Cargo.toml` and update `kodama` version to "0.3.0". - Remove `bytes` dependency from `src/obikrope/Cargo.toml` and set `criterion2` version to "3" with `cargo_bench_support`. - Add `tracing` and `tracing-subscriber` as dev-dependencies in `src/obiread/Cargo.toml`. - Remove `lazy_static` dependency from `src/obiskbuilder/Cargo.toml` and add `obikseq` as a test-utils dev-dependency. - Clarify `memo_key_from_debug` in `src/obiksession/src/memoize.rs` with comments explaining Debug-derived field usage. --- src/Cargo.lock | 10 ---------- src/obidebruinj/Cargo.toml | 2 -- src/obikdump/src/dump.rs | 2 +- src/obikindex/Cargo.toml | 4 ---- src/obikmer/Cargo.toml | 1 - src/obikphylo/Cargo.toml | 1 - src/obikrope/Cargo.toml | 1 - src/obiksession/src/memoize.rs | 3 +++ src/obiread/Cargo.toml | 7 +++++-- src/obiskbuilder/Cargo.toml | 1 - 10 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/Cargo.lock b/src/Cargo.lock index 337b95e7..4c09a281 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -1408,10 +1408,8 @@ version = "0.1.0" dependencies = [ "crossbeam-channel", "hashbrown 0.17.1", - "obifastwrite", "obikseq", "rayon", - "tracing", ] [[package]] @@ -1492,14 +1490,10 @@ dependencies = [ "ndarray", "niffler", "obicompactvec", - "obidebruinj", - "obikentropy", "obikseq", - "obipipeline", "obiread", "obiskio", "obisys", - "obitaxonomy", "ptr_hash", "rayon", "serde", @@ -1556,7 +1550,6 @@ dependencies = [ "obikrope", "obikselect", "obikseq", - "obiksession", "obikstats", "obipipeline", "obiread", @@ -1600,7 +1593,6 @@ dependencies = [ "obikseq", "obipipeline", "obiread", - "obiskbuilder", "obiskio", "obisys", "petgraph", @@ -1646,7 +1638,6 @@ dependencies = [ name = "obikrope" version = "0.1.0" dependencies = [ - "bytes", "criterion2", ] @@ -1724,7 +1715,6 @@ name = "obiskbuilder" version = "0.1.0" dependencies = [ "criterion2", - "lazy_static", "obikentropy", "obikrope", "obikseq", diff --git a/src/obidebruinj/Cargo.toml b/src/obidebruinj/Cargo.toml index debad64f..de1fc00c 100644 --- a/src/obidebruinj/Cargo.toml +++ b/src/obidebruinj/Cargo.toml @@ -5,11 +5,9 @@ edition = "2021" [dependencies] obikseq = { path = "../obikseq" } -obifastwrite = { path = "../obifastwrite" } hashbrown = { version = "0.17", features = ["rayon"] } rayon = "1" crossbeam-channel = "0.5" -tracing = "0.1" [features] test-utils = [] diff --git a/src/obikdump/src/dump.rs b/src/obikdump/src/dump.rs index b2dce101..61eb3cf1 100644 --- a/src/obikdump/src/dump.rs +++ b/src/obikdump/src/dump.rs @@ -81,7 +81,7 @@ impl IndexDump for Arc { if remaining.load(Ordering::Relaxed) == 0 { return Ok(vec![]); } let mut buf = Vec::::new(); let try_write = |buf: &mut Vec, row: &[u32], prefix: &str| -> bool { - match remaining.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |cur| { + match remaining.try_update(Ordering::SeqCst, Ordering::SeqCst, |cur| { if cur > 0 { Some(cur - 1) } else { None } }) { Err(_) => false, diff --git a/src/obikindex/Cargo.toml b/src/obikindex/Cargo.toml index 5153655b..0b52d8e8 100644 --- a/src/obikindex/Cargo.toml +++ b/src/obikindex/Cargo.toml @@ -5,13 +5,9 @@ edition = "2024" [dependencies] obikseq = { path = "../obikseq" } -obitaxonomy = { path = "../obitaxonomy" } obiskio = { path = "../obiskio" } obisys = { path = "../obisys", default-features = false } obicompactvec = { path = "../obicompactvec" } -obidebruinj = { path = "../obidebruinj" } -obipipeline = { path = "../obipipeline" } -obikentropy = { path = "../obikentropy" } cacheline-ef = "2.0" epserde = "0.13" ptr_hash = { version = "2.1", features = ["epserde"] } diff --git a/src/obikmer/Cargo.toml b/src/obikmer/Cargo.toml index f212ecf4..ac394aa1 100644 --- a/src/obikmer/Cargo.toml +++ b/src/obikmer/Cargo.toml @@ -24,7 +24,6 @@ obikstats = { path = "../obikstats" } obikquery = { path = "../obikquery" } obikidxcache = { path = "../obikidxcache" } obikphylo = { path = "../obikphylo" } -obiksession = { path = "../obiksession" } obikrope = { path = "../obikrope" } obifastwrite = { path = "../obifastwrite" } obiskbuilder = { path = "../obiskbuilder" } diff --git a/src/obikphylo/Cargo.toml b/src/obikphylo/Cargo.toml index a088f00d..6cf38773 100644 --- a/src/obikphylo/Cargo.toml +++ b/src/obikphylo/Cargo.toml @@ -10,7 +10,6 @@ obiskio = { path = "../obiskio" } obisys = { path = "../obisys", default-features = false } obicompactvec = { path = "../obicompactvec" } obikidxcache = { path = "../obikidxcache" } -obiskbuilder = { path = "../obiskbuilder" } obipipeline = { path = "../obipipeline" } kodama = "0.3.0" memmap2 = "0.9" diff --git a/src/obikrope/Cargo.toml b/src/obikrope/Cargo.toml index 1add0c6a..ded3335e 100644 --- a/src/obikrope/Cargo.toml +++ b/src/obikrope/Cargo.toml @@ -7,4 +7,3 @@ edition = "2024" criterion2 = { version = "3", features = ["cargo_bench_support"] } [dependencies] -bytes = "1.11.1" diff --git a/src/obiksession/src/memoize.rs b/src/obiksession/src/memoize.rs index 8271bc15..452ff275 100644 --- a/src/obiksession/src/memoize.rs +++ b/src/obiksession/src/memoize.rs @@ -342,6 +342,9 @@ mod tests { #[test] fn memo_key_from_debug() { + // Fields are only read through `Debug`, which is what the memo key + // is derived from — and what dead-code analysis ignores. + #[allow(dead_code)] #[derive(Debug)] struct Args { x: u64, diff --git a/src/obiread/Cargo.toml b/src/obiread/Cargo.toml index 10b20c97..ba6177b3 100644 --- a/src/obiread/Cargo.toml +++ b/src/obiread/Cargo.toml @@ -13,7 +13,10 @@ niffler = { version = "3", default-features = false, features = ["gz", "bz2", bzip2 = "0.6" liblzma = { version = "0.4", features = ["static"] } ureq = "3" -tracing = "0.1.44" -tracing-subscriber = { version = "0.3.23", features = ["fmt", "env-filter"] } infer = "0.22.0" regex = "1" + +[dev-dependencies] +# Used by examples/expand_path.rs only. +tracing = "0.1.44" +tracing-subscriber = { version = "0.3.23", features = ["fmt", "env-filter"] } diff --git a/src/obiskbuilder/Cargo.toml b/src/obiskbuilder/Cargo.toml index 1e5c0afb..02c206ae 100644 --- a/src/obiskbuilder/Cargo.toml +++ b/src/obiskbuilder/Cargo.toml @@ -8,7 +8,6 @@ obikseq = { path = "../obikseq" } obikrope = { path = "../obikrope" } obiread = { path = "../obiread" } obikentropy = { path = "../obikentropy" } -lazy_static = "1.5.0" [dev-dependencies] obikseq = { path = "../obikseq", features = ["test-utils"] }