Hi All, Any concerns over this patch? It merely adds the ability to detect some compiler errors when building BaseTools with Edk2ToolsBuild.py and report them as logging level ERROR to get a quick glimpse at the error without needing to review the entire log.
Thanks, Joey On Wed, Jun 21, 2023 at 8:59 AM Joey Vagedes <[email protected]> wrote: > 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]> > --- > 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.") > > -- > 2.41.0.windows.1 > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106706): https://edk2.groups.io/g/devel/message/106706 Mute This Topic: https://groups.io/mt/99685057/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
