-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: unused workspace dependency check breaks when replacing crates-io with a mirror #694
Labels
bug
Something isn't working
Comments
i think it's something to do with how the code compares the url for the crate against the expected url for crates.io, here: cargo-deny/src/diag/krate_spans.rs Lines 807 to 817 in 5da8b85
|
Hi there, we just ran into this on bottlerocket side with using cargo vendor. It seems when using a cargo vendor cargo deny fails to see the workspace dependency uses as well. |
qianxjcraig
added a commit
to qianxjcraig/bottlerocket-core-kit
that referenced
this issue
Mar 11, 2025
Temporarily allow unused workspace dependencies in cargo deny config to work around a known issue (cargo-deny#694) where the unused check fails when using registry mirrors or vendor directories. The issue causes false positives in the unused workspace dependency check when crates.io is replaced with a mirror or vendored dependencies. This change allows builds to proceed while maintaining other cargo deny checks. Reference: EmbarkStudios/cargo-deny#694
qianxjcraig
added a commit
to qianxjcraig/bottlerocket-kernel-kit
that referenced
this issue
Mar 11, 2025
Temporarily allow unused workspace dependencies in cargo deny config to work around a known issue (cargo-deny#694) where the unused check fails when using registry mirrors or vendor directories. The issue causes false positives in the unused workspace dependency check when crates.io is replaced with a mirror or vendored dependencies. This change allows builds to proceed while maintaining other cargo deny checks. Reference: EmbarkStudios/cargo-deny#694
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
the new
workspace-dependency.unused
setting reports false positives when you proxy crates.io via another cargo repository.i found this running against an internal artifactory mirror of crates.io, which for obvious reasons i can't use for a reproduction, but using a random (out of date) mirror i found on the web also reproduces it.
minimal repro repo available here
To reproduce
.cargo/config.toml
in the root of a cargo project:cargo deny check bans
despite the
wiremock
workspace dependency being used inbin/foo-lib/Cargo.toml
commenting out the
replace-with
line in the config.toml resolves the issue.cargo-deny version
cargo-deny 0.16.1
What OS were you running cargo-deny on?
MacOS
Additional context
No response
The text was updated successfully, but these errors were encountered: