oak icon indicating copy to clipboard operation
oak copied to clipboard

`cargo udeps` thinks some used dependencies are unused

Open andrisaar opened this issue 2 years ago • 0 comments

[15:04:27 ✓:0,✗:0,⠇:2] ┌[cargo udeps]
[15:04:27 ✓:0,✗:0,⠇:2] │┌[./Cargo.toml]
[15:04:27 ✓:0,✗:0,⠇:2] ││ cargo udeps --manifest-path=./Cargo.toml --all-targets --backend=depinfo --workspace
[15:07:33 ✓:0,✗:0,⠇:2] ││ ╔════════════════════════
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║ ════╡ stdout ╞════
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║ unused dependencies:
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║ `oak_remote_attestation v0.1.0 (/workspace/remote_attestation/rust)`
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║ └─── dependencies
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║      ├─── "aes-gcm"
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║      ├─── "hkdf"
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║      ├─── "p256"
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║      ├─── "sha2"
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║      ├─── "signature"
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║      └─── "x25519-dalek"
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║ Note: They might be false-positive.
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║       For example, `cargo-udeps` cannot detect usage of crates that are only used in doc-tests.
[15:07:33 ✓:0,✗:0,⠇:2] ││ ║       To ignore some dependencies, write `package.metadata.cargo-udeps.ignore` in Cargo.toml.

Those dependencies are used, cargo-udeps is wrong. For now, I've added the dependencies to package.metadata.cargo-udeps.ignore.

andrisaar avatar May 20 '22 15:05 andrisaar