Installing the same crate multiple times with different versions?


#1

Hi,

is there a possibility of installing the same crate multiple times with different versions?

[dependencies]
crate_name_v2 = {name = "crate-name", version = "2.0"}
crate_name_v3 = {name = "crate-name", version = "3.0"}

extern crate crate_name_v2;
extern crate crate_name_v3;

#2

To prevent something like the XY problem, what are you trying to do?


#3

#4

You would probably have to have two separate proxy crates to handle old/new logins and a way to either detect which to use, or try the other on failure of the first.

So your dep tree would look something like:

[your crate]
     |
     |-> [argonrs_old]
     |       |
     |       |-> [argonrs v1]
     |          
     |-> [argonrs_new]
            |
            |-> [argonrs v2]

#5

hmm, it’s kind of what i intended with the Cargo.toml crate “aliasing” but with “real” crates. Thank you for this.