EmbarkStudios / cargo-deny

❌ Cargo plugin for linting your dependencies 🦀

Home Page:http://embark.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] cargo deny only for deps required for a specific "phase" (normal, build, dev, etc)

banool opened this issue · comments

As in, not build or dev deps, similar to how it works with cargo tree:

cargo tree -e features,no-build,no-dev

My config, for context:

# This cargo deny file makes sure that for the Mac target, we don't take on OpenSSL
# deps for the normal (not build / dev) dependencies.

# It doesn't actually check for just normal deps right now:
# https://github.com/EmbarkStudios/cargo-deny/issues/563

all-features = false
no-default-features = false
targets = [
    { triple = "aarch64-apple-darwin" },
]

[advisories]
vulnerability = "allow"
unmaintained = "allow"
notice = "allow"
unsound = "allow"
yanked = "allow"

[licenses]
unlicensed = "allow"
copyleft = "allow"
default = "allow"

[bans]
multiple-versions = "allow"
wildcards = "allow"
workspace-default-features = "allow"
external-default-features = "allow"
# We need to make this only check for the normal deps, not build or dev.
deny = [
    { name = "openssl" },
    { name = "openssl-sys" },
    { name = "openssl-macros" },
]

[sources]
unknown-registry = "allow"
unknown-git = "allow"

Hey @repi @Jake-Shadle I don't suppose you know the answer to this?

You can't currently only check normal dependencies when checking for bans.

I see, thanks! I'll rename this issue then and turn it into a feature request hahah. If I get time I can look into it but I doubt that'll happen in the near future.