cargo-chef icon indicating copy to clipboard operation
cargo-chef copied to clipboard

cargo chef prepare always looks at dev dependencies, but those may not be relevant if building in release mode

Open itamarst opened this issue 3 years ago • 3 comments

cargo chef prepare is failing for me because it's looking for a dev dependency it can't find during a Docker build. Since I am going to build in release mode, looking for dev dependencies seems unnecessary.

I can work around it, but it would be nice if cargo chef prepare had a --release flag corresponding to cargo chef cook --release which just skipped any dev dependencies.

itamarst avatar Feb 16 '22 21:02 itamarst

The release profile is an orthogonal concept to development dependencies - e.g. you can build your test using the --release flag. We could enhance cargo-chef to determine if tests are included in the target and ignore dev-dependencies accordingly.

LukeMathWalker avatar Feb 17 '22 17:02 LukeMathWalker

Ah, right. Anyway as I said, this isn't actually something I need, but it seems useful. And it might speed up builds? So seems like a nice to have at least.

itamarst avatar Feb 17 '22 18:02 itamarst

This feature would be very helpful if a project has a dev-dependency on the migrations directory due to the use of sqlx or seaorm.

dreamerlzl avatar Dec 24 '23 15:12 dreamerlzl