I am working on a project to acquaint myself with Rust, and it's peculiarities. I am throwing bunch of things into a project including the kitchen sink. No this is not for production use just for testing the language and crates.
One problem I have run into is I have two separate crates that use different versions of the same sub-dependency. I know common protocol is to reduce or increase the version of one or both of those dependencies until they use a common version of the shared sub-dependency. However I want to be very bad and force one to use a slightly newer version since development stopped on it 6 years ago.
Thinking here is I can get some more experience by trying to fix abandon crate if it does not work with newer version (If it does not need too much wiring pulled out), or that it might magically work. I at least want the option to tinker.
Is there a way to do this with a parameter in the Cargo.toml for an initial test, or do I have to pull the repo locally, modify it's Cargo.toml, and reference that locally in my project Cargo file? I am curious.
You can override dependencies in your manifest, if that's what you are asking. Overridden dependencies are applied recursively to other crates in your dependency tree which also depend on the crate that is being overridden by you.
Not sure I followed that, as I think I tried that before, but might have missed a nuance.
I am trying to force the same sub-dependancy for argonautica = "0.2.0" & authoscope = "0.8.1".
They both use bindgen, I am trying to force them both to use the more recent version that authoscope uses bindgen = "0.58.0". argonautica is insistent on complaining about that.
From reading what you link to which I already had looked at. I previously tried using this by directly specifying bindgen in my dependencies, then adding this to the end to force using a specific versioning tag:
the package clang-sys links to the native library clang, but it conflicts with a previous package which links to clang as well:
package clang-sys v0.26.4
... which satisfies dependency clang-sys = "^0.26.4" of package bindgen v0.48.0
... which satisfies dependency bindgen = "^0.48" of package argonautica v0.2.0
... which satisfies dependency argonautica = "^0.2.0" of package ......
Although clang-sys is what it is complaining about, the version branching at bindgen is the problem. What am I missing if what you replied with is the way to handle this?
I don't think you can use argonautica on wasm32-unknown-unknown. It links against C code, which wasm32-unknown-unknown is currently not ABI compatible with. Maybe try the argon2 crate instead. This is a pure rust implementation of Argon2 should work fine on wasm32-unknown-unknown. It is also a lot better maintained.
Not building to WASM32 building to windows executable. And yes, I am expecting to have to compile C, that is why bindgen is there. I also will be building OpenSSL. The point of this particular project is poking all the bears in Rust development for myself.
EDIT: (Typo Fix) & Just want to know if this is possible, and if so how, since that doc jofas mentioned which I previously looked at does not seem to help me. I appreciate the insight.
error: failed to resolve patches for https://github.com/rust-lang/rust-bindgen
Caused by:
patch for bindgen in https://github.com/rust-lang/rust-bindgen points to the same source, but patches must point to different sources
Still looking for simple way to force a dependency, to use a certain version of a sub-dependency. To be clear same git repo, but different tag then main.
As far as I understand your problem, you'd need to patch argonautica with your version of it that updates bindgen to 0.58. You can't patch an old version of bindgen with a newer version, unless you pretend 0.58 is 0.48 by changing the version of a local copy of bindgen v0.58 to 0.48 and using that to override bindgen v0.48. The first approach, patching argonautica (or completely replacing it if it is not a transitive dependency) with a local copy that uses the newer bindgen, seems to me to be the better approach.
Yes, there's no way to say in your manifest file: "override dependency X to use a newer version of dependency Y". You can only say: "use this thing here as Y everywhere in the dependency graph", where "this thing here" is a version of Y that you modified (i.e. by updating one of its dependency requirements).