Skip to content

Support 4th level west -c config.ini file(s) #429

@pabigot

Description

@pabigot

In September 2025, the title was changed by @marc-hb from the original
"add environment support for defaulting arguments"
to:
"Support 4th level west -c config.ini file(s)"


Add environment support for defaulting arguments.

It would be wonderfully cool if west had a facility to infer defaults from environment variables.

I tend to build on a variety of boards. If I could do:

WEST_BUILD_BOARD=pca10056

and then have:

rm -rf build && west build

automatically infer --board pca10056 things would be easier.

Similarly I always sign with:

WEST_SIGN_KEY=${HOME}/.sensitive/pab-mcuboot.pem

It would be nice to avoid the extra arguments of:

west sign --key ${HOME}/.sensitive/pab-mcuboot.pem

or (from zephyrproject-rtos/zephyr#27688) have to use:

west build ... -- -DCONFIG_MCUBOOT_SIGNATURE_KEY_FILE=\"${HOME}/.sensitive/pab-mcuboot.pem\"

It's fairly common that I run the same sequence of commands on different boards to test them or assess why they're different. Having board-specific arguments complicates reproducing builds on different platforms. Taking parameters from the environment would allow me to have multiple shell windows, one for each board, with the commands (held in an editor buffer) being portable between them.

The variable name proposed here is WEST_<command>_<long-option> which seems automatable. Alternatively support an INI file that held defaults and could be selected by a single new global parameter that specified where to read them.

cc:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions