Skip to content

Commit

Permalink
edk2toolext/edk2_logging.py: Log rust errors
Browse files Browse the repository at this point in the history
Adds the ability to detect rust build errors and print them at the end
of the build when the build fails.
  • Loading branch information
Javagedes committed Sep 26, 2023
1 parent 21f9d65 commit deee5c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions edk2toolext/edk2_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def output_compiler_error(match, line, start_txt="Compiler"):
build_py_error_exp = re.compile(r"error (\d+)E:")
linker_error_exp = re.compile(r"error LNK(\d+):")
warning_exp = re.compile(r"warning [A-Z]?(\d+):")
rust_error_exp = re.compile(r"^(-->|\d+\s*\||error:)")

Check failure

Code scanning / CodeQL

Bad HTML filtering regexp High

This regular expression only parses --> and not --!> as a HTML comment end tag.
for raw_line in output_stream.readlines():
line = raw_line.strip("\n").strip()
match = error_exp.search(line)
Expand Down Expand Up @@ -260,6 +261,9 @@ def output_compiler_error(match, line, start_txt="Compiler"):
if match is not None:
error = output_compiler_error(match, line, "Build.py")
problems.append((logging.ERROR, error))
match = rust_error_exp.search(line)
if match is not None:
problems.append((logging.ERROR, line))
return problems


Expand Down

0 comments on commit deee5c7

Please sign in to comment.