-
Notifications
You must be signed in to change notification settings - Fork 141
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
Cargo audit false positives for optional dependencies pulled in by disabled features. #1119
Comments
Given IMO the real issue here is that the Cargo resolver is including these dependencies in Cargo.lock in the first place. I believe this issue might be relevant: |
Yeah I can definitely see your point there. That's a pretty old issue though and this is a pretty important feature for a project like this. Would it be possible for some type of temporary solution when we run cargo tree in the background and filter results based off that? I know that feels a bit dirty, but perhaps warranted? |
To properly consume data from Cargo.toml files / Rust workspaces it would be better if we optionally linked with |
Gotcha. Okay well we've got this documented here for now. Let me know if you come up with any clever solutions to this, cheers! |
Yeah, this is definitely a worthwhile issue to track, whether the solution happens upstream in Cargo or via new features added to |
The way to go for filtering would be |
The cargo issue I linked earlier suggests this issue occurs with |
It seems this issue is fixed in
|
Nevermind, I think it's only fixed for other lints, and security audits still run into this due to looking only at |
I think the issue is fixed inside the krate library that uses |
|
I'll give a minimal example here.
In my toml I have sqlx
Checking my actual dependencies with cargo tree reveals:
And yet I still get the error
I understand this is due to
cargo-audit
simply scanning the lock file, but I imagine ifcargo tree
is smart enough to omit these deps then the same should be possible incargo-audit
. Let me know what you think!The text was updated successfully, but these errors were encountered: