Skip to content

Commit 583c6fd

Browse files
committed
handle indented error messages when parsing Zig stderr output
Some Zig sub-compilations like compiler_rt will report error messages with extra indentation.
1 parent 0e44932 commit 583c6fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/features/diagnostics.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ pub fn getErrorBundleFromStderr(
385385

386386
var line_iterator = std.mem.splitScalar(u8, stderr_bytes, '\n');
387387
while (line_iterator.next()) |line| {
388-
var pos_and_diag_iterator = std.mem.splitScalar(u8, line, ':');
389-
388+
// `{optional indentation}{src_path}:{line}:{column}: {msg}`
389+
var pos_and_diag_iterator = std.mem.splitScalar(u8, std.mem.trimStart(u8, line, " "), ':');
390390
const src_path = pos_and_diag_iterator.next() orelse continue;
391391
const line_string = pos_and_diag_iterator.next() orelse continue;
392392
const column_string = pos_and_diag_iterator.next() orelse continue;

0 commit comments

Comments
 (0)