Skip to content

Commit 9a452a1

Browse files
committed
pkg/build: extract Rust build errors
Add a rust error regexp and a test to verify the resulting report.
1 parent 2c50b6a commit 9a452a1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

pkg/build/build.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ var buildFailureCauses = [...]buildFailureCause{
345345
{pattern: regexp.MustCompile(`FAILED unresolved symbol`)},
346346
{pattern: regexp.MustCompile(`No rule to make target`)},
347347
{pattern: regexp.MustCompile(`^Killed$`)},
348+
{pattern: regexp.MustCompile(`error\[.*?\]: `)},
348349
{weak: true, pattern: regexp.MustCompile(`: not found`)},
349350
{weak: true, pattern: regexp.MustCompile(`: final link failed: `)},
350351
{weak: true, pattern: regexp.MustCompile(`collect2: error: `)},

pkg/build/build_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,4 +591,24 @@ make: *** [Makefile:1231: vmlinux_o] Error 2
591591
"",
592592
"",
593593
},
594+
{`
595+
RUSTC L rust/kernel.o
596+
error[E0599]: no method named ` + "`data`" + ` found for struct ` + "`core::pin::Pin<kbox::Box<T, Kmalloc>>`" +
597+
` in the current scope
598+
--> rust/kernel/usb.rs:92:34
599+
|
600+
92 | T::disconnect(intf, data.data());
601+
| ^^^^ method not found in ` + "`Pin<Box<T, Kmalloc>>`" + `
602+
603+
error: aborting due to 1 previous error
604+
605+
For more information about this error, try ` + "`rustc --explain E0599`" + `.
606+
make[2]: *** [rust/Makefile:553: rust/kernel.o] Error 1
607+
make[1]: *** [/syzkaller/managers/ci-upstream-rust-kasan-gce/kernel/Makefile:1308: prepare] Error 2
608+
make: *** [Makefile:248: __sub-make] Error 2
609+
`,
610+
"error[E0599]: no method named `data` found for struct `core::pin::Pin<kbox::Box<T, Kmalloc>>` in the current scope",
611+
"",
612+
"",
613+
},
594614
}

0 commit comments

Comments
 (0)