-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Cannot disable Kconfig options from cmake command line #12244
Comments
Hi, the root cause is a bug in extensions.cmake:import_kconfig. import_kconfig assumes that "#" denotes a comment. But in actuality it can denote a value assignment. To avoid increasing the complexity of import_kconfig I believe it would be best to resolve this by resolving #5443. Then it is not longer an incorrect assumption that "#" denotes a comment in Zephyr. |
not sure what the use case is, but I do not think this is a bug per se and we should not enable this type of overrides, this can cause all kind of inconsistencies and dependency problems. If you want to disable an option, either use an overlay or disable the option directly in the project prj.conf |
This works fine now for enabling bool options, or setting other options. The use case is quickly enabling disabling an option without the need to modify files. So the only issue is unsetting bools |
Reopening. It is functionality which was added and was meant to work. It is not too critical to fix it, and therefore it can just stay (as it was) as low prio. |
when did it work? which commit did break it? |
Everything but setting a bool to "n" worked since #8487 (AFAIK). It was not broken by any commit, it was just not thoroughly enough tested, so we did not realized this case did not work as expected when it got in. |
Ok, so it never worked. |
Well.. at least in my simple mind, not more than we can guaranty it when setting it in an overlay file.. https://github.com/zephyrproject-rtos/zephyr/pull/8487/files |
As this never actually worked, maybe instead of considering it a bug, we should consider it an enhancement |
There's a new Used like this:
It will print a warning/error if the value can't be set, e.g. due to missing symbols or unsatisfied dependencies. |
Hi, I just found this old issue. It should be resolved as of cb46ed6, so I'm closing it. |
Describe the bug
When setting a boolean option to "n" as an argument when invoking cmake the option is lost, but setting them to "y" works as expected.
So for ex. :
cmake ../samples/hello_world/ -DBOARD=native_posix -GNinja -DCONFIG_NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME=y
works as expected, while
cmake ../samples/hello_world/ -DBOARD=native_posix -GNinja -DCONFIG_NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME=n
will not dump the option in CMakeCache.txt, and when calling ninja, cmake will be rerun, and the .config file will be regenerated, forgetting the selection.
To Reproduce
Steps to reproduce the behavior:
# CONFIG_NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME is not set
But CMakeCache.txt does not contain a line like
CONFIG_NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME:STRING=n
[0/1] Re-running CMake...
, and zephyr/.config now has that option set to yes.Expected behavior
CONFIG_NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME:STRING=n
Impact
Not possible to disable configuration options from the command line when invoking cmake.
Environment (please complete the following information):
( The feature was introduced in #8487 )
The text was updated successfully, but these errors were encountered: