refactor(deps): remove unused dependencies#32
Conversation
|
tACK e8718fc |
|
Independently arrived at the same changes via a dependency audit posted in Discussion #8. Confirmed the same 6 unused deps using both Nice that this PR also fixes the Closed my duplicate PR #35 in favor of this one. |
| use nix::libc; | ||
|
|
||
| #[cfg(target_os = "linux")] | ||
| use tracing_journald; |
There was a problem hiding this comment.
I believe the use tracing_journald; line is skipped
There was a problem hiding this comment.
skot is right. Also updated Cargo.toml, moving tracing-journald into [target.'cfg(target_os = "linux")'.dependencies], so it won't be compiled on macOS at all rather than just skipped.
Remove dependencies confirmed unused by cargo-machete analysis, as identified in the dependency audit (discussion 256foundation#8, issue 256foundation#29). mujina-miner: - sha2: bitcoin crate provides SHA-256 via bitcoin_hashes - hyper (direct): still available transitively via axum/reqwest - modular-bitfield: no usage in source mujina-dissect: - hex: no usage in source - thiserror: no usage in source - tracing: no usage in source (tracing-subscriber retained) Also removes sha2, hyper, and modular-bitfield from workspace dependencies as they are no longer referenced by any member. Eliminates ~15 exclusive transitive crates. Refs: 256foundation#29
Move tracing-journald from unconditional [dependencies] to [target.'cfg(target_os = "linux")'.dependencies] so it is not compiled on macOS. Gate the corresponding imports in tracing.rs (env, tracing_journald, prelude::*) behind cfg(target_os = "linux") to match, fixing unused-import warnings on macOS builds.
029692c to
60eddaf
Compare
|
Thanks for your first contribution, Nick, and welcome to the project! I restructured the commits slightly. The original first commit mixed dep removal with cfg-gating fixes in tracing.rs. I moved the cfg-gating changes into the second commit alongside the tracing-journald platform gating. Also changed the type from |
PR #32 introduced per-import #[cfg] annotations to suppress macOS warnings, and subsequent cleanup in the same area was piling up more scattered cfg blocks. Consolidate all journald logic into a mod journald gated once on target_os = "linux", with a no-op stub for other platforms. Rename init_journald_or_stdout to init since callers should not need to know the logging strategy.
Remove dependencies confirmed unused by cargo-machete analysis, as identified in the dependency audit (discussion #8, issue #29).
mujina-miner:
mujina-dissect:
Also removes sha2, hyper, and modular-bitfield from workspace dependencies as they are no longer referenced by any member.
Fix unused import warnings in tracing.rs by gating linux-only imports (env, tracing_journald, prelude) behind cfg(target_os).
Eliminates ~15 exclusive transitive crates.
Refs: #29