Re-implement proc-macro feature decoupling. by ehuss · Pull Request #8028 · rust-lang/cargo (original) (raw)
Yea it is funky, and I have to look it up every time I come across it.
cargo install
disables require_optional_deps
so that people who mirror a registry (like with a directory registry) don't need to have every optional dependency on disk (only the enabled ones). You can see the original motivation in #3369.
-Zavoid-dev-deps
is another way to disable require_optional_deps
, to get equivalent behavior with other commands, and was added much later.
I'm pretty sure we do not want to write Cargo.lock
in this mode, since it will be incomplete, and I think this has just been a pre-existing bug. But nothing really used it, so it didn't really matter or get noticed.
I changed it so that I could use resolve_ws
in the "yank" check for cargo install
, because I didn't want to trigger downloads, and didn't need the full power of resolve_ws_with_opts
. There are some comments above that I removed explaining this.