summaryrefslogtreecommitdiff
path: root/tools/buildman
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-20 02:48:22 +0300
committerSimon Glass <sjg@chromium.org>2023-07-24 18:34:10 +0300
commitad99599ca2b584eb388e09406c6ef2b21a488f0a (patch)
treecd60a58e1b2531ab5a32806a4d31ed57be72fb28 /tools/buildman
parentbec06ed8920ccf570ee80436488dd6426733bb15 (diff)
downloadu-boot-ad99599ca2b584eb388e09406c6ef2b21a488f0a.tar.xz
buildman: Detect boards with no CONFIG_TARGET defined
We generally expected exactly one of these. Add a check for it. Note: This warning is not displayed by default. An option will be added to enable it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman')
-rw-r--r--tools/buildman/boards.py4
-rw-r--r--tools/buildman/func_test.py13
2 files changed, 16 insertions, 1 deletions
diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py
index 56fb6f4de6..dabf694e0d 100644
--- a/tools/buildman/boards.py
+++ b/tools/buildman/boards.py
@@ -262,6 +262,10 @@ class KconfigScanner:
else:
target = tname
+ if not target:
+ cfg_name = expect_target.replace('-', '_').upper()
+ warnings.append(f'WARNING: {leaf}: No TARGET_{cfg_name} enabled')
+
params['target'] = expect_target
# fix-up for aarch64
diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index 154fa61c08..71f3029f15 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -951,6 +951,7 @@ Active aarch64 armv8 - armltd total_compute board2
# Add another TARGET to the Kconfig
tools.write_file(main, data, binary=False)
+ orig_kc_data = tools.read_file(kc_file)
extra = (b'''
if TARGET_BOARD2
config TARGET_OTHER
@@ -958,9 +959,19 @@ config TARGET_OTHER
\tdefault y
endif
''')
- tools.write_file(kc_file, tools.read_file(kc_file) + extra)
+ tools.write_file(kc_file, orig_kc_data + extra)
params_list, warnings = self._boards.build_board_list(config_dir, src)
self.assertEquals(2, len(params_list))
self.assertEquals(
['WARNING: board2_defconfig: Duplicate TARGET_xxx: board2 and other'],
warnings)
+
+ # Remove the TARGET_BOARD0 Kconfig option
+ lines = [b'' if line == b'config TARGET_BOARD2\n' else line
+ for line in orig_kc_data.splitlines(keepends=True)]
+ tools.write_file(kc_file, b''.join(lines))
+ params_list, warnings = self._boards.build_board_list(config_dir, src)
+ self.assertEquals(2, len(params_list))
+ self.assertEquals(
+ ['WARNING: board2_defconfig: No TARGET_BOARD2 enabled'],
+ warnings)