Let\'s say my project A depends on library B that depends on library C.
Library B sets the dependency version to \"*\" (any) so cargo will download the latest versio
I think you are going to have to check out Iron, modify Cargo.toml
to specify versions (as you have already done). Then you need to repeat the process, checking out url
, modify its Cargo.toml
, then make sure you are using your version of url
in Iron's Cargo.toml
. Rinse and repeat. This all sounds terrible :-(
From the Cargo docs:
Similar to before, let’s say you’re working on a project,
uuid
, which depends onrand
. This time you're the one who finds a bug inrand
, and you want to write a patch and be able to test out your patch by using your version ofrand
inuuid
.A path override is communicated to Cargo through the
.cargo/config
configuration mechanism. If Cargo finds this configuration when building your package, it will use the override on your local machine instead of the source specified in yourCargo.toml
.Inside that file, put this:
paths = ["/path/to/project/rand"]
Note This probably won't work. A thing someone told me when I was first starting Rust is that you can have multiple versions of the same library compiled into one binary. That would mean that there's no one place you can specify a version that applies all over, like you could with a Gemfile.
You might be able to simply specify versions (or SHA hashes?) for each dependency that you know works with your Rust version. Cargo should be able to resolve the transitive dependencies and simply lock you to a previous version (if there is one that fits all the requirements).
Since the anwser provided, Cargo has added the [patch]
section to the manifest which allows you to do this use case.
overriding-dependencies