Skip to content

Commit f76c7e3

Browse files
57300fabiobaltieri
authored andcommitted
scripts: ci: check_compliance: Account for board & SoC extensions
When a given board or SoC is extended, it has more than one directory associated with it, where the build system can look for Kconfig files. Make sure all of them are also included for Kconfig compliance checks. Signed-off-by: Grzegorz Swiderski <[email protected]>
1 parent 9bca492 commit f76c7e3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

scripts/ci/check_compliance.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@ def get_v2_model(self, kconfig_dir, settings_file):
523523

524524
with open(kconfig_defconfig_file, 'w') as fp:
525525
for board in v2_boards:
526-
fp.write('osource "' + (Path(board.dir) / 'Kconfig.defconfig').as_posix() + '"\n')
526+
for board_dir in board.directories:
527+
fp.write('osource "' + (board_dir / 'Kconfig.defconfig').as_posix() + '"\n')
527528

528529
with open(kconfig_boards_file, 'w') as fp:
529530
for board in v2_boards:
@@ -535,16 +536,18 @@ def get_v2_model(self, kconfig_dir, settings_file):
535536
re.sub(r"[^a-zA-Z0-9_]", "_", qualifier)).upper()
536537
fp.write('config ' + board_str + '\n')
537538
fp.write('\t bool\n')
538-
fp.write(
539-
'source "' + (Path(board.dir) / ('Kconfig.' + board.name)).as_posix() + '"\n\n'
540-
)
539+
for board_dir in board.directories:
540+
fp.write(
541+
'source "' + (board_dir / ('Kconfig.' + board.name)).as_posix() + '"\n'
542+
)
541543

542544
with open(kconfig_file, 'w') as fp:
543545
fp.write(
544546
'osource "' + (Path(kconfig_dir) / 'boards' / 'Kconfig.syms.v1').as_posix() + '"\n'
545547
)
546548
for board in v2_boards:
547-
fp.write('osource "' + (Path(board.dir) / 'Kconfig').as_posix() + '"\n')
549+
for board_dir in board.directories:
550+
fp.write('osource "' + (board_dir / 'Kconfig').as_posix() + '"\n')
548551

549552
kconfig_defconfig_file = os.path.join(kconfig_dir, 'soc', 'Kconfig.defconfig')
550553
kconfig_soc_file = os.path.join(kconfig_dir, 'soc', 'Kconfig.soc')
@@ -553,7 +556,7 @@ def get_v2_model(self, kconfig_dir, settings_file):
553556
root_args = argparse.Namespace(**{'soc_roots': soc_roots})
554557
v2_systems = list_hardware.find_v2_systems(root_args)
555558

556-
soc_folders = {soc.folder[0] for soc in v2_systems.get_socs()}
559+
soc_folders = {folder for soc in v2_systems.get_socs() for folder in soc.folder}
557560
with open(kconfig_defconfig_file, 'w') as fp:
558561
for folder in soc_folders:
559562
fp.write('osource "' + (Path(folder) / 'Kconfig.defconfig').as_posix() + '"\n')

0 commit comments

Comments
 (0)