Sorry for the delay.

Reviewed-by: Rebecca Cran <rebe...@bsdio.com>


On 6/21/23 9:59 AM, Joey Vagedes wrote:
Adds edk2_logging.scan_compiler_output() to Edk2ToolsBuild.py to catch
some compilation errors and log them as an error.

Cc: Rebecca Cran <rebe...@bsdio.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Bob Feng <bob.c.f...@intel.com>
Cc: Yuwei Chen <yuwei.c...@intel.com>
Signed-off-by: Joey Vagedes <joeyvage...@gmail.com>
---
  BaseTools/Edk2ToolsBuild.py | 11 +++++++++++
  1 file changed, 11 insertions(+)

diff --git a/BaseTools/Edk2ToolsBuild.py b/BaseTools/Edk2ToolsBuild.py
index f862468ce275..425bb1b63963 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.")


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106748): https://edk2.groups.io/g/devel/message/106748
Mute This Topic: https://groups.io/mt/99685057/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to