Skip to content

Commit

Permalink
scripts: ci: check_compliance: Inline creation of HWMv2 temp dirs
Browse files Browse the repository at this point in the history
The KCONFIG_BINARY_DIR/{boards,soc,arch}/ directories are only relevant
for `KconfigCheck.get_v2_model()`, so generate them within this method.

Signed-off-by: Grzegorz Swiderski <[email protected]>
  • Loading branch information
57300 authored and kartben committed Jan 17, 2025
1 parent c0d5e85 commit 37bce60
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions scripts/ci/check_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,12 @@ def get_v2_model(self, kconfig_dir, settings_file):
This is needed to complete Kconfig sanity tests.
"""
os.environ['HWM_SCHEME'] = 'v2'
os.environ["KCONFIG_BOARD_DIR"] = os.path.join(kconfig_dir, 'boards')

os.makedirs(os.path.join(kconfig_dir, 'boards'), exist_ok=True)
os.makedirs(os.path.join(kconfig_dir, 'soc'), exist_ok=True)
os.makedirs(os.path.join(kconfig_dir, 'arch'), exist_ok=True)

kconfig_file = os.path.join(kconfig_dir, 'boards', 'Kconfig')
kconfig_boards_file = os.path.join(kconfig_dir, 'boards', 'Kconfig.boards')
kconfig_defconfig_file = os.path.join(kconfig_dir, 'boards', 'Kconfig.defconfig')
Expand Down Expand Up @@ -585,14 +591,7 @@ def parse_kconfig(self):
# For Kconfig.dts support
self.get_kconfig_dts(os.path.join(kconfiglib_dir, "Kconfig.dts"),
os.path.join(kconfiglib_dir, "settings_file.txt"))

# To make compliance work with old hw model and HWMv2 simultaneously.
kconfiglib_boards_dir = os.path.join(kconfiglib_dir, 'boards')
os.makedirs(kconfiglib_boards_dir, exist_ok=True)
os.makedirs(os.path.join(kconfiglib_dir, 'soc'), exist_ok=True)
os.makedirs(os.path.join(kconfiglib_dir, 'arch'), exist_ok=True)

os.environ["KCONFIG_BOARD_DIR"] = kconfiglib_boards_dir
# For hardware model support (board, soc, arch)
self.get_v2_model(kconfiglib_dir, os.path.join(kconfiglib_dir, "settings_file.txt"))

# Tells Kconfiglib to generate warnings for all references to undefined
Expand Down

0 comments on commit 37bce60

Please sign in to comment.