LukeMathWalker / cargo-chef

A cargo-subcommand to speed up Rust Docker builds using Docker layer caching.
Apache License 2.0
1.72k stars 113 forks source link

Pass custom arguments to build commands #237

Closed mladedav closed 1 year ago

mladedav commented 1 year ago

Problem

I would like to pass --bins to the cargo build command run as part of cargo chef cook. This option is not supported though. There already are a lot of command line flags that are simply copied and passed to the underlying command.

Proposed Change

Allow custom arguments to be added for example through --additional-args or simply through cargo chef cook --clippy -- --clippy-arg-1 --etc. Then cargo-chef does not need to expose every cargo flag directly. Similarly, cargo-chef could allow custom commands to be used (instead of the predefined set check, build, clippy, and zigbuild)

Potential issues

Users could set flags that would prevent the clippy commands from working.

LukeMathWalker commented 1 year ago

We made an explicit choice of not doing this: certain flags influence the way in which cargo-chef might behave.

When a flag is desired, we investigate it and add it.