I am wondering do we have a way to make cargo reuse the dependencies globally.
Currently it’s really annoying that every crate downloads and compiles all the dependencies separately. (Correct if I am wrong) For example,
libc is a crate that is widely used and most of the crate specify the version like
libc >= "1.0" for instance. It sounds like we are able to use any version later than 1.0. So I assume its possible the build system keeps a copy of the latest build of crates globally and use them to build different projects.
And when each time the project is built, it the dependency specification doesn’t limit the highest version and the global cache meets the version requirement, it should be able to use the global cache directly.
It’s a little bit annoying even a tiny project just use a very long time to build the dependency.
I’m very curios if the similar feature already exists ? That sounds useful for me.