Cargo dependency hell

For semver-major incompatible versoins it's exactly the same as Node. If dependencies end up needing two conflicting versions of a library, Cargo will use two versions of the library and make sure each crate gets the version it wants. It's 100% automatic and reliable for Rust crates (with some caveats if you want to mix types/traits between crates).

The only hell here is C, which just can't do that. For C dependencies Cargo has links = "C library name" attribute that intentionally raises an error if there's more than one version of the same C library in one executable. So technically it's not Rust/Cargo's fault, but e.g. OpenSSL's problem that it can't coexist with another OpenSSL version.

15 Likes