I have a large OS project consisting of a virtual workspace with dozens of crates. When developing new features, I often need to temporarily use a different version of one crate for testing/development purposes, or swap back and forth between two versions of that crate. This is currently extremely tedious and error-prone, because I have to manually edit many Cargo.toml
manifests.
For example, I have a crate runqueue
, and there are 20+ other crates that depend on runqueue
, meaning that they have this in their manifest files:
[dependencies.runqueue]
path = "path/to/runqueue"
What I would like to be able to do is to replace runqueue
with runqueue_new
, without having to change the manifest file of every single crate that depends on runqueue
. Ideally, I'd like to do this such that every crate that depends on runqueue
in the entire workspace now satisfies that dependency with runqueue_new
instead of runqueue
.
I tried to use the patch
manifest section, but cannot figure out how to let it override local dependencies. It seems that you can only use patch
to override the crates-io registry or git sources.
[patch.'???']
runqueue = { path = "path/to/runqueue_new" }
I have no idea what to put for the ???
registry URL.
Is there a proper way to override a local dependency with another local dependency? Thanks!