From 496e9cdff8c6c31987f2367c0e23cd6f98cbb758 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Tue, 24 Sep 2024 14:21:37 +0200 Subject: [PATCH] fix(hints): handle multiple missing headers in the output The object files are compiled simultaneously, which can result in several error messages about missing headers. The current regex used to find missing headers in the compiler's output employs a greedy search, potentially capturing multiple error messages from different compilation units. This can cause bug reports where the original component cannot be identified. Strengthen the regex to ensure it only processes the first reported error. Signed-off-by: Frantisek Hrbata --- tools/idf_py_actions/hint_modules/component_requirements.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/idf_py_actions/hint_modules/component_requirements.py b/tools/idf_py_actions/hint_modules/component_requirements.py index 92e3a66825..fc9eff39f6 100644 --- a/tools/idf_py_actions/hint_modules/component_requirements.py +++ b/tools/idf_py_actions/hint_modules/component_requirements.py @@ -8,7 +8,7 @@ from idf_py_actions.tools import get_build_context ''' glossary: -orignal_component: component which compilation failed +original_component: component which compilation failed source_component: component containing file which is including the missing header file candidate_component: component which contain the missing header file original_filename: abs path of file(compilation unit) in original_component @@ -21,7 +21,7 @@ ENOENT_RE = re.compile(r'^(.+):\d+:\d+: fatal error: (.+): No such file or direc flags=re.MULTILINE) # Regex to find full preprocessor's error message to identify the original_filename # in case the missing_header is reported in indirect include. -ENOENT_FULL_RE = re.compile(r'^(In file included.*No such file or directory)$', +ENOENT_FULL_RE = re.compile(r'^(In file included.*?No such file or directory)$', flags=re.MULTILINE | re.DOTALL) # Regex to find original_filename in preprocessor's error message ORIGINAL_FILE_RE = re.compile(r'.*from (.*):[\d]+:')