From fa789cc68a85a5781c18c64b9112c779750b2125 Mon Sep 17 00:00:00 2001 From: Joey Vagedes Date: Wed, 21 Jun 2023 08:44:15 -0700 Subject: BaseTools: scan Edk2ToolsBuild.py make output Adds edk2_logging.scan_compiler_output() to Edk2ToolsBuild.py to catch some compilation errors and log them as an error. Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen Signed-off-by: Joey Vagedes Reviewed-by: Rebecca Cran --- BaseTools/Edk2ToolsBuild.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BaseTools/Edk2ToolsBuild.py b/BaseTools/Edk2ToolsBuild.py index f862468ce2..425bb1b639 100644 --- a/BaseTools/Edk2ToolsBuild.py +++ b/BaseTools/Edk2ToolsBuild.py @@ -133,8 +133,13 @@ class Edk2ToolsBuild(BaseAbstractInvocable): shell_env.insert_path(self.OutputDir) # Actually build the tools. + output_stream = edk2_logging.create_output_stream() ret = RunCmd('nmake.exe', None, workingdir=shell_env.get_shell_var("EDK_TOOLS_PATH")) + edk2_logging.remove_output_stream(output_stream) + problems = edk2_logging.scan_compiler_output(output_stream) + for level, problem in problems: + logging.log(level, problem) if ret != 0: raise Exception("Failed to build.") @@ -143,7 +148,13 @@ class Edk2ToolsBuild(BaseAbstractInvocable): elif self.tool_chain_tag.lower().startswith("gcc"): cpu_count = self.GetCpuThreads() + + output_stream = edk2_logging.create_output_stream() ret = RunCmd("make", f"-C . -j {cpu_count}", workingdir=shell_env.get_shell_var("EDK_TOOLS_PATH")) + edk2_logging.remove_output_stream(output_stream) + problems = edk2_logging.scan_compiler_output(output_stream) + for level, problem in problems: + logging.log(level, problem) if ret != 0: raise Exception("Failed to build.") -- cgit v1.2.3