Skip to content

Commit

Permalink
[nrf fromtree] scripts: ci: check_compliance: Remove HWMv1 dead code
Browse files Browse the repository at this point in the history
HWMv1-specific Kconfig checks were meant to be removed before HWMv2 was
merged into `main` (see `collab-hwm` history), but some traces remained.
Do another round of cleanup.

Signed-off-by: Grzegorz Swiderski <[email protected]>
(cherry picked from commit c0d5e85)
  • Loading branch information
57300 committed Feb 26, 2025
1 parent 236b8ec commit 3990c4d
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions scripts/ci/check_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,32 +485,6 @@ def get_kconfig_dts(self, kconfig_dts_file, settings_file):
except subprocess.CalledProcessError as ex:
self.error(ex.output.decode("utf-8"))

def get_v1_model_syms(self, kconfig_v1_file, kconfig_v1_syms_file):
"""
Generate a symbol define Kconfig file.
This function creates a file with all Kconfig symbol definitions from
old boards model so that those symbols will not appear as undefined
symbols in hardware model v2.
This is needed to complete Kconfig compliance tests.
"""
os.environ['HWM_SCHEME'] = 'v1'
# 'kconfiglib' is global
# pylint: disable=undefined-variable

try:
kconf_v1 = kconfiglib.Kconfig(filename=kconfig_v1_file, warn=False)
except kconfiglib.KconfigError as e:
self.failure(str(e))
raise EndTest

with open(kconfig_v1_syms_file, 'w') as fp_kconfig_v1_syms_file:
for s in kconf_v1.defined_syms:
if s.type != kconfiglib.UNKNOWN:
fp_kconfig_v1_syms_file.write('config ' + s.name)
fp_kconfig_v1_syms_file.write('\n\t' + kconfiglib.TYPE_TO_STR[s.type])
fp_kconfig_v1_syms_file.write('\n\n')

def get_v2_model(self, kconfig_dir, settings_file):
"""
Get lists of v2 boards and SoCs and put them in a file that is parsed by
Expand Down Expand Up @@ -553,9 +527,6 @@ def get_v2_model(self, kconfig_dir, settings_file):
)

with open(kconfig_file, 'w') as fp:
fp.write(
'osource "' + (Path(kconfig_dir) / 'boards' / 'Kconfig.syms.v1').as_posix() + '"\n'
)
for board in v2_boards:
for board_dir in board.directories:
fp.write('osource "' + (board_dir / 'Kconfig').as_posix() + '"\n')
Expand Down

0 comments on commit 3990c4d

Please sign in to comment.