Skip to content

Commit

Permalink
BaseTools: scan Edk2ToolsBuild.py make output
Browse files Browse the repository at this point in the history
Adds edk2_logging.scan_compiler_output() to Edk2ToolsBuild.py to catch
some compilation errors and log them as an error.

Cc: Rebecca Cran <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Bob Feng <[email protected]>
Cc: Yuwei Chen <[email protected]>
Signed-off-by: Joey Vagedes <[email protected]>

Reviewed-by: Rebecca Cran <[email protected]>
  • Loading branch information
Javagedes authored and mergify[bot] committed Aug 2, 2023
1 parent 5cadb8c commit fa789cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions BaseTools/Edk2ToolsBuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ def Go(self):
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.")

Expand All @@ -143,7 +148,13 @@ def Go(self):

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.")

Expand Down

0 comments on commit fa789cc

Please sign in to comment.