Auto merge of #2406 - alexcrichton:download-less, r=brson
authorbors <bors@rust-lang.org>
Mon, 29 Feb 2016 19:32:24 +0000 (19:32 +0000)
committerbors <bors@rust-lang.org>
Mon, 29 Feb 2016 19:32:24 +0000 (19:32 +0000)
Currently Cargo will download an entire resolution graph all at once when in fact most packages may not be relevant to a compilation. For example target-specific dependencies and dev-dependencies are unconditionally downloaded regardless of whether they're actually needed or not.

This commit alters the internals of Cargo to avoid downloading everything immediately and just switches to lazily downloading packages. This involved adding a new `LazyCell` primitive (similar to the one in use on crates.io) and also propagates `CargoResult` in a few more locations.

Overall this ended up being a pretty large refactoring so the commits are separated in bite-sized chunks as much as possible with the end goal being this PR itself.

Closes #2394

1  2 
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_install.rs

Simple merge
Simple merge