tools: leave out kconf platform targets

This commit is contained in:
Ramon Roche
2022-02-11 12:50:01 -08:00
parent af8c6d3cef
commit 4243be3a4b
2 changed files with 40 additions and 40 deletions
+2 -2
View File
@@ -108,9 +108,9 @@ jobs:
with: with:
python-version: 3.9 python-version: 3.9
- name: Install Python packages #- name: Install Python packages
#run: pip install -r Tools/setup/requirements.txt #run: pip install -r Tools/setup/requirements.txt
run: pip install kconfiglib #run: pip install kconfiglib
- id: set-matrix - id: set-matrix
name: Get all nuttx targets name: Get all nuttx targets
+38 -38
View File
@@ -6,14 +6,14 @@ import os
import sys import sys
import json import json
import re import re
from kconfiglib import Kconfig # from kconfiglib import Kconfig
kconf = Kconfig() # kconf = Kconfig()
# Supress warning output # Supress warning output
kconf.warn_assign_undef = False # kconf.warn_assign_undef = False
kconf.warn_assign_override = False # kconf.warn_assign_override = False
kconf.warn_assign_redun = False # kconf.warn_assign_redun = False
source_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..') source_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
@@ -49,46 +49,46 @@ bloaty_helpers = [
'bloaty_compare_master', 'bloaty_compare_master',
] ]
def process_target(px4board_file, target_name): # def process_target(px4board_file, target_name):
ret = None # ret = None
platform = None # platform = None
toolchain = None # toolchain = None
if px4board_file.endswith("default.px4board") or \ # if px4board_file.endswith("default.px4board") or \
px4board_file.endswith("recovery.px4board") or \ # px4board_file.endswith("recovery.px4board") or \
px4board_file.endswith("bootloader.px4board"): # px4board_file.endswith("bootloader.px4board"):
kconf.load_config(px4board_file, replace=True) # kconf.load_config(px4board_file, replace=True)
else: # Merge config with default.px4board # else: # Merge config with default.px4board
default_kconfig = re.sub(r'[a-zA-Z\d_]+\.px4board', 'default.px4board', px4board_file) # default_kconfig = re.sub(r'[a-zA-Z\d_]+\.px4board', 'default.px4board', px4board_file)
kconf.load_config(default_kconfig, replace=True) # kconf.load_config(default_kconfig, replace=True)
kconf.load_config(px4board_file, replace=False) # kconf.load_config(px4board_file, replace=False)
if "BOARD_TOOLCHAIN" in kconf.syms: # if "BOARD_TOOLCHAIN" in kconf.syms:
toolchain = kconf.syms["BOARD_TOOLCHAIN"].str_value # toolchain = kconf.syms["BOARD_TOOLCHAIN"].str_value
if "BOARD_PLATFORM" in kconf.syms: # if "BOARD_PLATFORM" in kconf.syms:
platform = kconf.syms["BOARD_PLATFORM"].str_value # platform = kconf.syms["BOARD_PLATFORM"].str_value
assert platform, f"PLATFORM not found in {px4board_file}" # assert platform, f"PLATFORM not found in {px4board_file}"
if platform not in excluded_platforms: # if platform not in excluded_platforms:
# get the container based on the platform and toolchain # # get the container based on the platform and toolchain
container = platform # container = platform
if platform == 'posix': # if platform == 'posix':
container = 'base-focal' # container = 'base-focal'
if toolchain: # if toolchain:
if toolchain.startswith('aarch64'): # if toolchain.startswith('aarch64'):
container = 'aarch64' # container = 'aarch64'
elif toolchain == 'arm-linux-gnueabihf': # elif toolchain == 'arm-linux-gnueabihf':
container = 'armhf' # container = 'armhf'
else: # else:
if verbose: print(f'possibly unmatched toolchain: {toolchain}') # if verbose: print(f'possibly unmatched toolchain: {toolchain}')
elif platform == 'nuttx': # elif platform == 'nuttx':
container = 'nuttx-focal' # container = 'nuttx-focal'
ret = {'target': target_name, 'container': container} # ret = {'target': target_name, 'container': container}
return ret # return ret
def process_bloaty(target_path, target_name): def process_bloaty(target_path, target_name):
response = [] response = []