[Concept,06/18] buildman: Fix config value change detection

Message ID 20260109183116.3262115-7-sjg@u-boot.org
State New
Headers
Series buildman: Improve test coverage for builder.py |

Commit Message

Simon Glass Jan. 9, 2026, 6:30 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Config value changes are never detected because tconfig.config.get(key)
looks up the config key in the filename-keyed dict instead of the config
dict for the current file.

Change to tconfig.config[name].get(key) to correctly look up the config
value in the current file's config dict.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 tools/buildman/builder.py   | 2 +-
 tools/buildman/func_test.py | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
  

Patch

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 4bcde84adca..3cb14af279f 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -1624,7 +1624,7 @@  class Builder:
                     config_minus[key] = value
                     all_config_minus[key] = value
             for key, value in base.items():
-                new_value = tconfig.config.get(key)
+                new_value = tconfig.config[name].get(key)
                 if new_value and value != new_value:
                     desc = f'{value} -> {new_value}'
                     config_change[key] = desc
diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index 817cd6e7a7f..b80779017b4 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -651,8 +651,10 @@  Some images are invalid'''
         self.assertEqual(self._make_calls, 0)
         lines = terminal.get_print_test_lines()
         text = '\n'.join(line.text for line in lines)
-        # Check config options appear in the output
-        self.assertIn('CONFIG_', text)
+        # Check config options appear in the output - both additions and
+        # value changes should be detected
+        self.assertIn('CONFIG_NEW_OPTION', text)  # Addition
+        self.assertIn('CONFIG_VALUE', text)  # Value change
         self.assertIn('(no errors to report)', lines[-1].text)
 
     def testCount(self):