tools/ci: Added the fix for build_apps in build_apps.py

This commit is contained in:
shripad621git
2024-01-11 20:59:52 +05:30
committed by liyashuai
parent c0b7f5574b
commit 382afc8bf6
+12 -10
View File
@@ -9,7 +9,10 @@ import sys
from pathlib import Path from pathlib import Path
from typing import List from typing import List
from idf_build_apps import LOGGER, App, build_apps, find_apps, setup_logging import logging
idf_build_apps_logger = logging.getLogger('idf_build_apps')
from idf_build_apps import App, build_apps, find_apps, setup_logging
# from idf_ci_utils import IDF_PATH, get_pytest_app_paths, get_pytest_cases, get_ttfw_app_paths # from idf_ci_utils import IDF_PATH, get_pytest_app_paths, get_pytest_cases, get_ttfw_app_paths
@@ -38,9 +41,9 @@ MAINFEST_FILES = [
] ]
def _is_c6_pytest_app(app: App) -> bool: def _is_c6_pytest_app(app: App) -> bool:
print(app.name , app.target) print(app.name, app.target)
for pytest_app in PYTEST_C6_APPS: for pytest_app in PYTEST_C6_APPS:
print(pytest_app["name"] , pytest_app["target"]) print(pytest_app["name"], pytest_app["target"])
if app.name == pytest_app["name"] and app.target == pytest_app["target"]: if app.name == pytest_app["name"] and app.target == pytest_app["target"]:
return True return True
return False return False
@@ -68,15 +71,14 @@ def get_cmake_apps(
target=target, target=target,
build_dir='build_@t_@w', build_dir='build_@t_@w',
config_rules_str=config_rules_str, config_rules_str=config_rules_str,
build_log_path='build_log.txt', build_log_filename='build_log.txt',
size_json_path='size.json', size_json_filename='size.json',
check_warnings=False, check_warnings=False,
preserve=True, preserve=True,
manifest_files=MAINFEST_FILES, manifest_files=MAINFEST_FILES,
) )
return apps return apps
def main(args: argparse.Namespace) -> None: def main(args: argparse.Namespace) -> None:
apps = get_cmake_apps(args.paths, args.target, args.config) apps = get_cmake_apps(args.paths, args.target, args.config)
@@ -93,8 +95,8 @@ def main(args: argparse.Namespace) -> None:
else: else:
apps_for_build = apps[:] apps_for_build = apps[:]
LOGGER.info('Found %d apps after filtering', len(apps_for_build)) idf_build_apps_logger.info('Found %d apps after filtering', len(apps_for_build))
LOGGER.info( idf_build_apps_logger.info(
'Suggest setting the parallel count to %d for this build job', 'Suggest setting the parallel count to %d for this build job',
len(apps_for_build) // APPS_BUILD_PER_JOB + 1, len(apps_for_build) // APPS_BUILD_PER_JOB + 1,
) )
@@ -113,7 +115,6 @@ def main(args: argparse.Namespace) -> None:
sys.exit(ret_code) sys.exit(ret_code)
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Build all the apps for different test types. Will auto remove those non-test apps binaries', description='Build all the apps for different test types. Will auto remove those non-test apps binaries',
@@ -176,4 +177,5 @@ if __name__ == '__main__':
if not arguments.paths: if not arguments.paths:
arguments.paths = [DEF_APP_PATH] arguments.paths = [DEF_APP_PATH]
setup_logging(verbose=1) # Info setup_logging(verbose=1) # Info
main(arguments) main(arguments)