-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add --download-only
option for multi-crate workspaces
#250
Comments
I've had the same issue, try running it with Or do you need the package to have different features than the workspace? |
After #260 it is possible to do:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
I had run into an issue where chef wasn't caching properly because I'm using a workspace with multiple crates.
A minimal Dockerfile example could be:
Here, the package chosen may change the feature selection on some dependencies, which can cause a large recompile. Chef will have built for all packages, and so the dependencies will use the maximal feature set, while the
build -p package
may choose a smaller feature set for some dependencies and recompile a large amount of code.In my particular case, I have a single cargo workspace and Dockerfile where I am building multiple containers from different crates.
The options for cargo chef in a workspace are either:
I can see an outstanding issue (#180) that hints at usage of a workspace with multiple crates and may be suffering the same fate.
Proposal
Add a
cargo chef fetch
orcargo chef cook --download-only
to download dependencies, but avoid compiling them. I'm ignorant to howcargo chef
is implemented, but thecargo fetch
command could hopefully provide the functionality?Documentation
It might be worth adding a point about workspaces and crates depending on different features, it took me a few hours to figure out what was happening! Perhaps as a troubleshooting guide, or some form of "here's what's recommended for workspaces with multiple crates" section in the README?
The text was updated successfully, but these errors were encountered: