Closed mladedav closed 8 months ago
I am running into the same issue and tried to use --all-targets
but that didn't really help at all. I've contemplated to just invoke cargo chef cook
multiple times, one for each binary. Until #241 is being released, would that be equivalent?
We have a workspace with several projects, each containing one binary.
We would like to have a single caching layer where all dependencies for all binaries are already precompiled and then compile only the binaries themselves so that there aren't multiple cache docker layers.
Another thing I have noticed is
cargo chef
accepts only one--bin
argument whilecargo build
et al. allow for multiple binaries to be specified. Either of those would help in our situation if you have reservations about either.Originally I wanted to do just simple
cargo chef cook
andcargo build -p package
, but it turns out this leads to several recompilations, seemingly because of feature sets and possibly other issues.cargo chef cook
followed bycargo build --bin package
is somewhat better, but there were still a few recompilations (although I didn't check closer why yet). The only way currently available I have found iscargo chef cook --all-targets
but that of course also compiles a lot of stuff we do not want.