We have a workspace that has a few crates we use as libraries. I.e, a layout like so:
- library1/lib.rs
- library2/lib.rs <-- depends on
library1
- binary/main.rs <-- depends on
library1 & library2
With cargo chef cook & prepare, both the libraries and binary are all skeleton files, so we can never cache library1 & library2, they are built each time.
One possible solution is to layer it, so we run cargo chef cook a couple of times to build up the cache layers. However, we'd need an option to ensure that cargo chef does not create/overwrite skeleton files for certain crates within the workspace.
I.e, you could imagine:
- prepare
- copy over the
recipe.json
- copy over just
library1
- cook, but exclude skeletons for
library1
- copy over
library2
- cook, but exclude skeletons for
library1 & library2
- full build
We have a workspace that has a few crates we use as libraries. I.e, a layout like so:
library1library1&library2With cargo chef cook & prepare, both the libraries and binary are all skeleton files, so we can never cache library1 & library2, they are built each time.
One possible solution is to layer it, so we run
cargo chef cooka couple of times to build up the cache layers. However, we'd need an option to ensure that cargo chef does not create/overwrite skeleton files for certain crates within the workspace.I.e, you could imagine:
recipe.jsonlibrary1library1library2library1&library2