Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Zephyr builder: Add escaping for the 'vars' parameter
Fix the issue with passing the "vars" parameters from the configuration moulin YAML file to the build.ninja context. The 'vars' parameter of the Zephyr builder is placed into the bash -c "... cmd ..." context. It requires an additional level of escaping to be added to the 'vars' parameter. But that is not enough. The 'vars' parameter is passed to the 'west build' call. West, in turn, passes those 'vars' parameter to CMake. On the CMake level, Zephyr splits all incoming CMake parameters into 2 parts: 1. Those, which start with the "CONFIG_" prefix 2. All the others The first group of parameters is stored in the KConfig file. When users pass a string to Kconfig through CMake, they are expected to pass it so that quotes are correct seen from Kconfig, that is: > cmake -DCONFIG_A_STRING=\"foo bar\" In this case, to obtain the required level of escaping: - the first group of parameters should be additionally escaped twice on the moulin level - the second group of parameters should be additionally escaped once on the moulin level As a result of this patch, the user can specify the 'vars' on the yaml level in the following way: vars: - "CONFIG_KERNEL_BIN_NAME=\"%{KERNEL_BIN_NAME}\"" - "MY_VARIABLE=\"1234567890\"" Signed-off-by: Mykhailo Androsiuk <[email protected]>
- Loading branch information