Skip to content
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 deny does not apply bans to path dependencies #343

Open
Moxinilian opened this issue Apr 25, 2021 · 1 comment
Open

cargo deny does not apply bans to path dependencies #343

Moxinilian opened this issue Apr 25, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@Moxinilian
Copy link

Moxinilian commented Apr 25, 2021

Describe the bug
If a crate imported by path in the same workspace is mentioned in the ban deny list, cargo check will not error. This also seems to happen transitively.

To Reproduce

  1. Create a worspace with crateA and crateB.
  2. Make crateA have a path dependency on crateB by doing crateB = { path = "../crateB" }
  3. In the deny.toml of crateA, make crateB banned in the deny list.
  4. Ask for a cargo deny check on crateA from within crateA's folder.

Expected behavior
cargo deny check should error as crateB is not allowed as a crateA dependency. Instead, checks pass.

Device:

  • OS: Linux

Additional context
The reason I want to deny a crate from the same workspace as a dependency is that I am making a client and a server in the same workspace so they can share a common network crate. However when the workspace will inevitably have a more intricate dependency graph, I would like to ensure I don't accidentally link server code in the client.

@Moxinilian Moxinilian added the bug Something isn't working label Apr 25, 2021
@Moxinilian
Copy link
Author

I have some free time available so if this is indeed unwanted behavior I can try to look into it @Jake-Shadle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant