Skip to content

Conversation

@yashi
Copy link

@yashi yashi commented Oct 30, 2025

menuconfig and guiconfig failed on range value.

How to reproduce:

menuconfig

west update
rm -rf build
west build -t menuconfig -p -b qemu_cortex_m3 zephyr/samples/hello_world

guiconfig

west update
rm -rf build
west build -t guiconfig -p -b qemu_cortex_m3 zephyr/samples/hello_world

Once the UI is up, go to any node with int value like CONFIG_SRAM_SIZE or CONFIG_LOG_CORE_INIT_PRIORITY.

This was unnotices after 0276d10.

See the commit message for more details.

ref) zephyrproject-rtos/zephyr#98595

yashi added 2 commits October 31, 2025 02:09
The commit 125d0daaa17aa added 'loc' to the sym.ranges tuples and fixed
kconfiglib.py but menuconfig.py is left untouched. This make menuconfig to
die with:

  Traceback (most recent call last):
    File ".../scripts/kconfig/menuconfig.py", line 3284, in <module>
      _main()
      ~~~~~^^
    File ".../scripts/kconfig/menuconfig.py", line 663, in _main
      menuconfig(standard_kconfig(__doc__))
      ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File ".../scripts/kconfig/menuconfig.py", line 732, in menuconfig
      print(curses.wrapper(_menuconfig))
            ~~~~~~~~~~~~~~^^^^^^^^^^^^^
    File "/usr/lib/python3.13/curses/__init__.py", line 94, in wrapper
      return func(stdscr, *args, **kwds)
    File ".../scripts/kconfig/menuconfig.py", line 872, in _menuconfig
      _change_node(sel_node)
      ~~~~~~~~~~~~^^^^^^^^^^
    File ".../scripts/kconfig/menuconfig.py", line 1586, in _change_node
      s, _range_info(sc))
         ~~~~~~~~~~~^^^^
    File ".../scripts/kconfig/menuconfig.py", line 3119, in _range_info
      for low, high, cond in sym.ranges:
          ^^^^^^^^^^^^^^^
  ValueError: too many values to unpack (expected 3)

This commit ignores the last element in the tuples.

Signed-off-by: Yasushi SHOJI <[email protected]>
The commit 125d0daaa17aa added 'loc' to the sym.ranges tuples and fixed
kconfiglib.py but guiconfig.py is left untouched. This make menuconfig to
die with:

  Exception in Tkinter callback
  Traceback (most recent call last):
    File "/usr/lib/python3.13/tkinter/__init__.py", line 2077, in __call__
      return self.func(*args)
             ~~~~~~~~~^^^^^^^
    File ".../scripts/kconfig/guiconfig.py", line 917, in _tree_double_click
      return _tree_enter(event)
    File ".../scripts/kconfig/guiconfig.py", line 942, in _tree_enter
      _change_node(node, tree.winfo_toplevel())
      ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File ".../scripts/kconfig/guiconfig.py", line 1125, in _change_node
      s = _set_val_dialog(node, parent)
    File ".../scripts/kconfig/guiconfig.py", line 1219, in _set_val_dialog
      range_info = _range_info(sym)
    File ".../scripts/kconfig/guiconfig.py", line 1339, in _range_info
      for low, high, cond in sym.ranges:
          ^^^^^^^^^^^^^^^
  ValueError: too many values to unpack (expected 3)

This commit ignores the last element in the tuples.

Signed-off-by: Yasushi SHOJI <[email protected]>
Copy link
Contributor

@pillo79 pillo79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and thanks! 🙇

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

Successfully merging this pull request may close these issues.

2 participants