chore(deps): remove unused dependencies#35
Closed
average-gary wants to merge 1 commit into256foundation:mainfrom
Closed
chore(deps): remove unused dependencies#35average-gary wants to merge 1 commit into256foundation:mainfrom
average-gary wants to merge 1 commit into256foundation:mainfrom
Conversation
Remove dependencies confirmed unused by cargo-machete and manual audit: mujina-miner: - sha2: bitcoin crate provides SHA-256 via bitcoin_hashes - hyper: only used transitively via axum/reqwest, not directly - modular-bitfield: never imported in source code mujina-dissect: - hex: never imported in source code - thiserror: never imported in source code - tracing: never imported in source code Eliminates 15 exclusive transitive dependencies from the build. See: 256foundation#8
Contributor
Author
|
Closing in favor of #32 which covers the same dependency removals and additionally fixes the pre-existing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove 6 dependencies confirmed unused by two independent tools and manual source audit.
mujina-miner
sha2— thebitcoincrate provides SHA-256 viabitcoin_hashes;sha2is never importedhyper(direct) — only used transitively via axum/reqwest, never imported directlymodular-bitfield— never imported anywhere in source codemujina-dissect
hex— never importedthiserror— never importedtracing— never importedTool Evidence
cargo-machete(source-code heuristic, stable Rust)Searches source files for
use <crate>patterns. Finds zero matches for all 6 deps:cargo +nightly udeps(compiler-level analysis)Uses unstable compiler flags to determine which crates are actually linked:
cargo-udepsonly flagsmodular-bitfieldbecausesha2andhyperare still compiled as transitive dependencies of other crates (axum, utoipa-swagger-ui). They are linked into the binary even though no source code imports them. Removing them as direct dependencies is still correct — they remain available transitively for the crates that actually need them.Why both tools?
cargo-udepscargo-macheteuseorextern cratein sourceTogether they provide high confidence:
modular-bitfieldis confirmed by both tools.sha2,hyper,hex,thiserror, andtracingare confirmed by machete's source scan and corroborated by manual grep showing zero imports.Impact
Eliminates 15 exclusive transitive dependencies from the build. Zero code changes — only Cargo.toml deletions.
Verification
cargo check --workspace— passcargo test --workspace --features skip-pty-tests— 283 passed, 0 failedcargo machete— clean (no unused deps detected after removal)cargo fmt --check— passCloses #34
See: #8