`cargo concordium build` command doesn't support `--features` option

I would like to ask a question about the build command. I use multiple configuration files in the project, and I want to be able to control the imported configuration through --features when building, but it seems that the cargo concordium build directive does not support the --features option. Is there any solution? Code example:

#[cfg(feature = “local”)]
mod local_constants;
#[cfg(feature = “local”)]
use local_constants::*;

#[cfg(any(
feature = “production”,
feature = “development”,
feature = “sandbox”,
feature = “local”
))]
const ONE: StakingBalanceAmount = 1u8;

Hi.

The --features (and in general other cargo build options) are supported, you just have to supply them after a --. So for example

cargo concordium build -- --features=bump_alloc

All arguments after -- will be passed directly to cargo.

Thanks for your help, but I get an error when I use the --features option. Is this related to the version of cargo or concordium instructions?

As I wrote you need to provide these extra flags after a -- separator. So put -- before the --features flag.

:rofl: :rofl:
I cracked up at my stupidity…

1 Like