Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimise recipe.json when cargo chef prepare is called with a --bin flag #208

Open
LukeMathWalker opened this issue Apr 19, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@LukeMathWalker
Copy link
Owner

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.

@LukeMathWalker LukeMathWalker added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Apr 19, 2023
@markdingram
Copy link
Contributor

I think this would follow on nicely from #169

An earlier version had a "collect_local_packages" that walked down from the workspace_packages collecting all local manifests
585a0f5

Realised that wasn't necessary for #169, but it could serve as the basis for this

@etep
Copy link

etep commented Oct 11, 2024

There are no examples of how to use the --bin for prepare. Curious to know, are we supposed to use one of the following:

--bin app                      # raw binary name
--bin target/release/app       # the path into the build collateral
--bin services/app             # the path into the source code (kind of...)
--bin services/src/app         # the path toward main.rs but with app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants