From 027a1509be77f6d9228f14b461f6f190b2c3edd8 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Wed, 27 May 2026 08:52:51 +0800 Subject: [PATCH] fix(tools): dont call idf_size.py for linux target Calling idf.py size on linux target project would cause an error. This was a problem for IDEs or build script which often call this as the last step in the build process, as it could mark the whole "build" as failed. --- tools/idf_py_actions/core_ext.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/idf_py_actions/core_ext.py b/tools/idf_py_actions/core_ext.py index b1d3d359bc2..f94f9c6db08 100644 --- a/tools/idf_py_actions/core_ext.py +++ b/tools/idf_py_actions/core_ext.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 import fnmatch import glob @@ -28,6 +28,7 @@ from idf_py_actions.tools import PropertyDict from idf_py_actions.tools import TargetChoice from idf_py_actions.tools import ensure_build_directory from idf_py_actions.tools import generate_hints +from idf_py_actions.tools import get_build_context from idf_py_actions.tools import get_target from idf_py_actions.tools import idf_version from idf_py_actions.tools import merge_action_lists @@ -131,6 +132,12 @@ def action_extensions(base_actions: dict, project_path: str) -> Any: force_progression=GENERATORS[args.generator].get('force_progression', False), custom_error_handler=tool_error_handler, ) + + proj_desc = get_build_context().get('proj_desc') or {} + if proj_desc.get('target') == 'linux': + print("Note: 'idf.py size' is not supported for the 'linux' target; skipping size analysis.") + return + run_target(target_name, args, env=env) def list_build_system_targets(target_name: str, ctx: Context, args: PropertyDict) -> None: