diff options
author | Joey Vagedes <joey.vagedes@gmail.com> | 2023-06-21 08:44:15 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-08-02 15:20:47 +0000 |
commit | fa789cc68a85a5781c18c64b9112c779750b2125 (patch) | |
tree | 899037f2d053b567d8b393eb45d6d13e67175612 | |
parent | 5cadb8ce2148979b6c464f6da5a8cd97425c5165 (diff) | |
download | edk2-fa789cc68a85a5781c18c64b9112c779750b2125.tar.gz |
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 <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Joey Vagedes <joeyvagedes@gmail.com>
Reviewed-by: Rebecca Cran <rebecca@bsdio.com>
-rw-r--r-- | BaseTools/Edk2ToolsBuild.py | 11 |
1 files changed, 11 insertions, 0 deletions
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.")
|