aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/build
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-11-03 10:38:30 +0100
committerAleksandr Nogikh <nogikh@google.com>2025-11-03 13:16:05 +0000
commit9a452a17ecba225f211cf6389c0eae9995bb0538 (patch)
treef898de5534627eac9706c006eb62bf7f72c7f9cd /pkg/build
parent2c50b6a91afe391fad4d14f7b7d7167d570089dd (diff)
pkg/build: extract Rust build errors
Add a rust error regexp and a test to verify the resulting report.
Diffstat (limited to 'pkg/build')
-rw-r--r--pkg/build/build.go1
-rw-r--r--pkg/build/build_test.go20
2 files changed, 21 insertions, 0 deletions
diff --git a/pkg/build/build.go b/pkg/build/build.go
index a9d23cbe0..a77bd3963 100644
--- a/pkg/build/build.go
+++ b/pkg/build/build.go
@@ -345,6 +345,7 @@ var buildFailureCauses = [...]buildFailureCause{
{pattern: regexp.MustCompile(`FAILED unresolved symbol`)},
{pattern: regexp.MustCompile(`No rule to make target`)},
{pattern: regexp.MustCompile(`^Killed$`)},
+ {pattern: regexp.MustCompile(`error\[.*?\]: `)},
{weak: true, pattern: regexp.MustCompile(`: not found`)},
{weak: true, pattern: regexp.MustCompile(`: final link failed: `)},
{weak: true, pattern: regexp.MustCompile(`collect2: error: `)},
diff --git a/pkg/build/build_test.go b/pkg/build/build_test.go
index 7491a113c..841c56962 100644
--- a/pkg/build/build_test.go
+++ b/pkg/build/build_test.go
@@ -591,4 +591,24 @@ make: *** [Makefile:1231: vmlinux_o] Error 2
"",
"",
},
+ {`
+ RUSTC L rust/kernel.o
+error[E0599]: no method named ` + "`data`" + ` found for struct ` + "`core::pin::Pin<kbox::Box<T, Kmalloc>>`" +
+ ` in the current scope
+ --> rust/kernel/usb.rs:92:34
+ |
+92 | T::disconnect(intf, data.data());
+ | ^^^^ method not found in ` + "`Pin<Box<T, Kmalloc>>`" + `
+
+error: aborting due to 1 previous error
+
+For more information about this error, try ` + "`rustc --explain E0599`" + `.
+make[2]: *** [rust/Makefile:553: rust/kernel.o] Error 1
+make[1]: *** [/syzkaller/managers/ci-upstream-rust-kasan-gce/kernel/Makefile:1308: prepare] Error 2
+make: *** [Makefile:248: __sub-make] Error 2
+`,
+ "error[E0599]: no method named `data` found for struct `core::pin::Pin<kbox::Box<T, Kmalloc>>` in the current scope",
+ "",
+ "",
+ },
}