-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exported variables are not seen by CMake when calling west #613
Comments
Can you please elaborate on that? I'd be very surprised to learn that |
@efra-mx-aqua thanks for the report; could you please provide the cmake commands you use which work as expected, for comparison? |
@marc-hb @mbolivar-nordic I have updated the description with the missing information |
Thanks @efra-mx-aqua . I tried to reproduce with qemu_x86. As I expected, --- a/samples/hello_world/prj.conf
+++ b/samples/hello_world/prj.conf
+# Fails with error: unrecognized command-line option '--not-an-option'
+CONFIG_COMPILER_OPT="--not-an-option" --- a/samples/hello_world/prj.conf
+++ b/samples/hello_world/prj.conf
+# Fails with error: ${CLI_OPT}: linker input file not found: No such file or directory
+# NO variable expansion
+CONFIG_COMPILER_OPT="${CLI_OPT}" I'm not sure what weird "magic" causes environment variables to be expanded in the following line but it's the expansion that looks like a bug to me:
Environment variables are generally speaking a "build code smell": they hide very well and they cause subtle differences which are very difficult to find and reproduce. Many commands "cleanse" the environment. https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#how-can-i-get-or-set-environment-variables |
I figured out what was wrong, sorry for the noise. I can reproduce now, thanks for the detailed steps. This is all down to a difference between Ninja and Make, it has nothing to do with
I highly recommend against this though because: 1. Environment variables are bad, see above 2. This gives the wrong impression that environment variables are supported in Maybe you could generate some Anyway this is about environment variables, kconfig and Make and has absolutely nothing to do with PS: setting CONFIG_MCUBOOT_SIGNATURE_KEY_FILE in prj.conf is more convenient for reproduction |
@marc-hb thank you for the information. I am by no mean expert in how the Kconfig works, so I tried that and noticed that defining I have had problems to pass the image version to the signing script, but that is another issue. |
Exported variables are not seen by west. I have notices that when signing binaries
In our project we have been building the code using CMake, but now we are doing the transition to use West.
how to reproduce
Before building define these variables
Add this to the "prj.conf"
Build using:
Result
The image signing fails because the variables HEADER_SIZE, IMG_FW_VERSION and SLOT_SIZE do not exits
Expected result
That the variables a visible, therefore the signing will work
workaround
Calling cmake directly
log:
output:
environment
OS: linux
zephyr: 2.7.2
west: 0.11, 0.14
The text was updated successfully, but these errors were encountered: