From a4de7c8ac4c22b2643822a6d9c0d9fbd38ac0587 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Tue, 17 Dec 2024 10:56:26 +0100 Subject: [PATCH] fix(hints): improve suggestion for missing header file Currently, we are only suggesting that the header file is likely not part of the component's INCLUDE_DIRS. However, the header file may be missing also because of the configuration settings. For instance, the component might be disabled in sdkconfig, or the feature that supplies the header might not be enabled. Enhance the hint message to address this scenario as well. Signed-off-by: Frantisek Hrbata --- tools/idf_py_actions/hint_modules/component_requirements.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/idf_py_actions/hint_modules/component_requirements.py b/tools/idf_py_actions/hint_modules/component_requirements.py index 92e3a66825..b681b39115 100644 --- a/tools/idf_py_actions/hint_modules/component_requirements.py +++ b/tools/idf_py_actions/hint_modules/component_requirements.py @@ -144,7 +144,9 @@ def generate_hint(output: str) -> Optional[str]: candidates = ', '.join(candidate_component_include_dirs) return (f'Missing "{missing_header}" file name found in the following component(s): {candidates}. ' f'Maybe one of the components needs to add the missing header directory to INCLUDE_DIRS ' - f'of idf_component_register call in CMakeLists.txt.') + f'of idf_component_register call in CMakeLists.txt. Another possibility may be that the ' + f'component or its feature is not enabled in the configuration. Use "idf.py menuconfig" ' + f'to check if the required options are enabled.') # The missing header not found anywhere, nothing much we can do here. return None