Cargo vendoring now on nightly


#1

Support has now landed on nightly for Cargo to support replaced sources which primarily includes the ability to vendor dependencies. More documentation and information can be found online and in the associated PR, but if you’d like to give it a spin, you can try out:

$ cargo install cargo-vendor
$ cd path/to/project
$ cargo vendor

And you should be good to go! Note that this requires a nightly version of Cargo right now, and rustup is a great way to get it!

If you’ve got any problems, feel free to either ask here or open an issue!


#2

Yay, now I can finally develop Rust on the plane!

Why the two different but mostly equivalent methods? (local-registry and vendor)

If I use this, will there no longer be a separate copy of the dependency sources in ~/.cargo?


#3

The two are intended for somewhat different use cases, where local-registry provides guaranteed reproducible builds and is suitable for “build a binary blob to ship elsewhere to build”. The directory case is moreso for “I’d like to commit this source somewhere” and cannot provide the exact same guarantees a local-registry but enough for our purposes.

For local registries they’ll get unpacked into ~/.cargo but directory sources will not.


#4

Do I see this correctly that this is not meant to allow shipping of crates with all necessary dependencies? That is a feature I was frequently asked about.


#5

Yeah for now this is just targeted at crates.io, not necessarily all git dependencies as well.


#6

ipfs mirror incoming?! <3