cargo-chef
cargo-chef copied to clipboard
Minimise `recipe.json` when `cargo chef prepare` is called with a `--bin` flag
cargo-chef slims down the workspace members to just the specified binary when cargo chef prepare is invoked with a --bin flag.
At the moment (see #207) we still keep around ALL other local manifests, in case the binary depends on another one of the local crates via a path dependency.
To maximise cache reuse, we could be more sophisticated: only include in the recipe.json file the manifests of the local crates that are in the dependency closure of the specified binary target.
I think this would follow on nicely from https://github.com/LukeMathWalker/cargo-chef/pull/169
An earlier version had a "collect_local_packages" that walked down from the workspace_packages collecting all local manifests https://github.com/LukeMathWalker/cargo-chef/commit/585a0f5e8784e2be0dc0c9da0dfb5d4915f703a4
Realised that wasn't necessary for #169, but it could serve as the basis for this