Open
Description
openedon Aug 21, 2018
I'm writing a crate that uses thread_local!
and lazy_static!
variables. If this crate is duplicated in the dependency graph, functions risk being called with non-up-to-date global variables, and Bad Things™ (though hopefully no unsafe, but panics for almost certain) will ensue.
As a consequence, I wonder if there could a way for a crate to ask cargo not to allow to pull it twice in the dependency tree. Maybe a do-not-pull-twice
attribute on the crate that could be overridden by a --yes-pull-this-twice
… something to at least error against the common case of unwillingly pulling a dependency that's brittle in this regard? :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Area: dependency resolution and the resolverArea: dependency resolution and the resolverCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Status: Needs an RFC to make progress.Status: Needs an RFC to make progress.