From 9cf276ed24ef22e6cf13a9acc686b9bd24c53925 Mon Sep 17 00:00:00 2001 From: houseme Date: Wed, 26 Aug 2026 22:51:27 +0800 Subject: [PATCH] chore(deps): clean up cargo shear findings (#6679) Remove unused direct dependency declarations found by cargo-shear and delete the unlinked ecstore mimalloc diagnostics file. Keep feature-forwarding dependencies explicit with package-local cargo-shear ignores so hotpath feature propagation remains intact. Co-authored-by: heihutu --- Cargo.lock | 5 ---- Cargo.toml | 1 - crates/ecstore/Cargo.toml | 10 ++++--- crates/ecstore/src/memory_observability.rs | 33 ---------------------- crates/lifecycle/Cargo.toml | 3 ++ rustfs/Cargo.toml | 3 -- 6 files changed, 9 insertions(+), 46 deletions(-) delete mode 100644 crates/ecstore/src/memory_observability.rs diff --git a/Cargo.lock b/Cargo.lock index 79a87afae..52ed828ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9380,7 +9380,6 @@ dependencies = [ "rustfs-log-analyzer", "rustfs-madmin", "rustfs-mimalloc", - "rustfs-mimalloc-sys", "rustfs-notify", "rustfs-object-capacity", "rustfs-object-data-cache", @@ -9581,7 +9580,6 @@ dependencies = [ "bytesize", "chrono", "criterion", - "enumset", "faster-hex", "flatbuffers", "futures", @@ -9615,7 +9613,6 @@ dependencies = [ "path-absolutize", "pin-project-lite", "proptest", - "quick-xml 0.42.0", "rand 0.10.2", "ratelimit", "rcgen", @@ -9661,11 +9658,9 @@ dependencies = [ "serde_json", "serde_urlencoded", "serial_test", - "sha1 0.11.0", "sha2 0.11.0", "shadow-rs", "smallvec", - "starshard", "temp-env", "tempfile", "thiserror 2.0.20", diff --git a/Cargo.toml b/Cargo.toml index 35b61c7fc..c7eafa5ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -366,7 +366,6 @@ dav-server = "0.11.0" # Performance Analysis and Memory Profiling rustfs-mimalloc = { version = "0.5.1" } -rustfs-mimalloc-sys = { version = "0.5.1" } hotpath = { version = "0.24.0", default-features = false } # Snapshot testing for output format regression detection insta = { version = "1.48" } diff --git a/crates/ecstore/Cargo.toml b/crates/ecstore/Cargo.toml index fc488fd77..41d6af83b 100644 --- a/crates/ecstore/Cargo.toml +++ b/crates/ecstore/Cargo.toml @@ -25,6 +25,12 @@ keywords = ["erasure-coding", "storage", "rustfs", "Minio", "solomon"] categories = ["web-programming", "development-tools", "filesystem"] documentation = "https://docs.rs/rustfs-ecstore/latest/rustfs_ecstore/" +[package.metadata.cargo-shear] +ignored = [ + "rustfs-checksums", + "rustfs-signer", + "rustfs-tls-runtime", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lints] @@ -129,7 +135,6 @@ hotpath-cpu = [ test-util = [] [dependencies] -starshard = { workspace = true } hotpath.workspace = true rustfs-filemeta.workspace = true rustfs-utils = { workspace = true, features = ["full"] } @@ -171,7 +176,6 @@ serde = { workspace = true, features = ["derive"] } time = { workspace = true, features = ["parsing", "formatting", "macros", "serde"] } bytesize.workspace = true serde_json = { workspace = true, features = ["raw_value"] } -quick-xml = { workspace = true, features = ["serialize", "async-tokio"] } s3s = { workspace = true, features = ["minio"] } http.workspace = true opentelemetry.workspace = true @@ -193,7 +197,6 @@ tokio-util = { workspace = true, features = ["io", "compat"] } tokio-stream = { workspace = true, features = ["sync"] } base64 = { workspace = true } hmac = { workspace = true } -sha1 = { workspace = true } sha2 = { workspace = true } hex-simd = { workspace = true } tempfile.workspace = true @@ -208,7 +211,6 @@ tonic = { workspace = true, features = ["gzip", "deflate"] } xxhash-rust = { workspace = true, features = ["xxh64", "xxh3"] } tower = { workspace = true, features = ["timeout"] } async-channel.workspace = true -enumset = { workspace = true } num_cpus = { workspace = true } rand = { workspace = true, features = ["serde"] } pin-project-lite.workspace = true diff --git a/crates/ecstore/src/memory_observability.rs b/crates/ecstore/src/memory_observability.rs deleted file mode 100644 index bebf7fdce..000000000 --- a/crates/ecstore/src/memory_observability.rs +++ /dev/null @@ -1,33 +0,0 @@ - -/// Check mimalloc arena configuration and log diagnostics -pub fn log_mimalloc_diagnostics() { - #[cfg(feature = "mimalloc")] - { - use rustfs_mimalloc::MiMalloc; - - // Check arena_max_object_size - let arena_max_obj_size = MiMalloc::option_get_size( - rustfs_mimalloc_sys::mi_option_t::mi_option_arena_max_object_size - ); - tracing::info!( - arena_max_object_size_bytes = arena_max_obj_size, - "mimalloc arena_max_object_size" - ); - - // Check if pagemap is enabled - let pagemap_commit = MiMalloc::option_is_enabled( - rustfs_mimalloc_sys::mi_option_t::mi_option_pagemap_commit - ); - tracing::info!( - pagemap_commit = pagemap_commit, - "mimalloc pagemap_commit" - ); - - // Log version - let version = MiMalloc::version(); - tracing::info!( - mimalloc_version = version, - "mimalloc version" - ); - } -} diff --git a/crates/lifecycle/Cargo.toml b/crates/lifecycle/Cargo.toml index 76f9d198c..002bf7c82 100644 --- a/crates/lifecycle/Cargo.toml +++ b/crates/lifecycle/Cargo.toml @@ -25,6 +25,9 @@ keywords = ["lifecycle", "storage", "rustfs", "Minio"] categories = ["web-programming", "development-tools", "filesystem"] documentation = "https://docs.rs/rustfs-lifecycle/latest/rustfs_lifecycle/" +[package.metadata.cargo-shear] +ignored = ["rustfs-common"] + [features] default = [] hotpath = [ diff --git a/rustfs/Cargo.toml b/rustfs/Cargo.toml index 3d7dddf62..6fbedae51 100644 --- a/rustfs/Cargo.toml +++ b/rustfs/Cargo.toml @@ -353,9 +353,6 @@ rustfs-mimalloc = { workspace = true } [target.'cfg(target_os = "linux")'.dependencies] libsystemd.workspace = true -[target.'cfg(not(target_os = "windows"))'.dependencies] -rustfs-mimalloc-sys = { workspace = true } - [dev-dependencies] uuid = { workspace = true, features = ["v4", "v5", "fast-rng", "macro-diagnostics"] } serial_test = { workspace = true }