Skip to content
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

Broken comparison against kconfiglib.expr_value() (IDFGH-294) #2195

Closed
ulfalizer opened this issue Jul 14, 2018 · 2 comments
Closed

Broken comparison against kconfiglib.expr_value() (IDFGH-294) #2195

ulfalizer opened this issue Jul 14, 2018 · 2 comments

Comments

@ulfalizer
Copy link

Hello,

Stumbled upon this when browsing the code a bit:

if kconfiglib.expr_value(cond_expr) != "n":

expr_value() returns a 0/1/2 tristate value, so will need to be e.g. this instead:

if kconfiglib.expr_value(cond_expr):

Similarly here too:

if kconfiglib.expr_value(cond_expr) != "n":

And yeah, that 0/1/2 vs. n/m/y thing is a bit confusing. It simplifies comparisons and streamlines the implementation a bit at least.

Cheers,
Ulf

@FayeY FayeY changed the title Broken comparison against kconfiglib.expr_value() [TW#24582] Broken comparison against kconfiglib.expr_value() Jul 26, 2018
@projectgus
Copy link
Contributor

Hi @ulfalizer ,

I don't know why I didn't see this before now. Thanks so much, your observation is of course 100% correct! Fix incoming soon.

(Still haven't forgotten about updating to upstream kconfiglib as well - but also haven't had time to do so :|.)

@ulfalizer
Copy link
Author

ulfalizer commented Mar 1, 2019

(Still haven't forgotten about updating to upstream kconfiglib as well - but also haven't had time to do so :|.)

No worries!

If you want to quickly try out the menuconfig, you could apply the patch below (just to work around some env. variables not being set), install Kconfiglib with pip3 install kconfiglib, and run menuconfig in the esp-idf root. (Shameless plug. :)

No obligation though. I realize you have lots of stuff to do.

diff --git a/Kconfig b/Kconfig
index 75815ba1a..8bc9a2ac2 100644
--- a/Kconfig
+++ b/Kconfig
@@ -56,7 +56,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
 
     endmenu  # SDK tool configuration
 
-    source "$COMPONENT_KCONFIGS_PROJBUILD"
+    #source "$COMPONENT_KCONFIGS_PROJBUILD"
 
     menu "Compiler options"
 
@@ -203,5 +203,5 @@ mainmenu "Espressif IoT Development Framework Configuration"
     endmenu # Compiler Options
 
     menu "Component config"
-        source "$COMPONENT_KCONFIGS"
+        #source "$COMPONENT_KCONFIGS"
     endmenu

@projectgus projectgus changed the title [TW#24582] Broken comparison against kconfiglib.expr_value() Broken comparison against kconfiglib.expr_value() (IDFGH-294) Mar 12, 2019
igrr pushed a commit that referenced this issue Mar 13, 2019
When generating JSON metadata for ranges where there are conditional ranges (ie different allowed range
depending on another config setting), the JSON metadata would always have the last named range as
the expression was not evaluated properly.

Thanks to ulfalizer on GitHub for pointing this out.

Closes #2195
@igrr igrr closed this as completed in 673441a Mar 13, 2019
igrr pushed a commit that referenced this issue Mar 13, 2019
When generating JSON metadata for ranges where there are conditional ranges (ie different allowed range
depending on another config setting), the JSON metadata would always have the last named range as
the expression was not evaluated properly.

Thanks to ulfalizer on GitHub for pointing this out.

Closes #2195
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
When generating JSON metadata for ranges where there are conditional ranges (ie different allowed range
depending on another config setting), the JSON metadata would always have the last named range as
the expression was not evaluated properly.

Thanks to ulfalizer on GitHub for pointing this out.

Closes espressif/esp-idf#2195
espressif-bot pushed a commit to espressif/esp-idf-kconfig that referenced this issue Oct 24, 2022
When generating JSON metadata for ranges where there are conditional ranges (ie different allowed range
depending on another config setting), the JSON metadata would always have the last named range as
the expression was not evaluated properly.

Thanks to ulfalizer on GitHub for pointing this out.

Closes espressif/esp-idf#2195
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants