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

Maintain default deny-multiple-versions list #664

Open
Swatinem opened this issue May 29, 2024 · 1 comment
Open

Maintain default deny-multiple-versions list #664

Swatinem opened this issue May 29, 2024 · 1 comment

Comments

@Swatinem
Copy link

In general, deny-multiple-versions is nice to have.
But there is also use-cases like global contexts, where having multiple versions of the same crate can actually lead to wrong behavior.

Using sentry as an example, it happens quite frequently that version X is used to capture panics, but version Y is the one that is configured to send reports to sentry.
Since the versions are different and thus have two incompatible global contexts, the result is that panics are not being sent upstream, and the crate malfunctions for the users.
This was brought up yet again for Sentry here: getsentry/sentry-rust#661

This problem is not unique to sentry, but in general for crates using global contexts, like tracing, various metrics related crates, etc.


It might be nice to maintain an explicit default deny-list in cargo-deny for such crates which is stronger than the default warn level.

@Jake-Shadle
Copy link
Member

I don't think I would ever add something like that to cargo-deny as it would be too confusing for users, and would only help those who actually user cargo-deny, not the many who don't, meaning crates such as yours would still get reports. That being said I wouldn't be against adding a metadata field for cargo-deny that it can use to warn/error for users if they do use cargo deny, eg.

[package.metadata.cargo-deny]
# Having multiple versions of this crate can cause a user's crate/workspace to malfunction, they need to align on one version
multiple-versions = "deny"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants