aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/build/build_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-03-29 11:00:34 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-03-29 11:00:34 +0100
commit9633c5c8a1a030cdfdc0f94ae460314c7fc15faa (patch)
tree01efde3d54f1261007510e6662045f07f1621cd2 /pkg/build/build_test.go
parent6b138f0f3ced97b0260f6253874d7c84c6408662 (diff)
pkg/build: extract bazel build errors
We currently manually call extractRootCause in few selected places to denote kernel build errors that we want to report to developers. The rest are considered infra errors that we don't report. This does not work well. We are missing fuchsia and gvisor build errors. Treat all external command exection failures as kernel build errors instead. Let's see how this works in practice. Also add bazel-specfic error patterns and tests.
Diffstat (limited to 'pkg/build/build_test.go')
-rw-r--r--pkg/build/build_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/build/build_test.go b/pkg/build/build_test.go
index 3900dfaf7..7f0a9e607 100644
--- a/pkg/build/build_test.go
+++ b/pkg/build/build_test.go
@@ -66,6 +66,24 @@ make: *** Waiting for unfinished jobs....
`,
"/gcc-5.5.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.5.0/plugin/include/builtins.h:23:17: fatal error: mpc.h: No such file or directory",
},
+ {`
+Starting local Bazel server and connecting to it...
+Loading:
+Loading: 0 packages loaded
+Analyzing: target //runsc:runsc (1 packages loaded)
+Analyzing: target //runsc:runsc (5 packages loaded)
+Analyzing: target //runsc:runsc (15 packages loaded)
+Analyzing: target //runsc:runsc (92 packages loaded)
+Analyzing: target //runsc:runsc (99 packages loaded)
+Analyzing: target //runsc:runsc (115 packages loaded)
+ERROR: /syzkaller/managers/ptrace-direct-overlay-host/kernel/vdso/BUILD:13:1: no such target '@bazel_tools//tools/cpp:cc_flags': target 'cc_flags' not declared in package 'tools/cpp' defined by /syzkaller/home/.cache/bazel/_bazel_root/e1c9d86bae2b34f90e83d224bc900958/external/bazel_tools/tools/cpp/BUILD and referenced by '//vdso:vdso'
+ERROR: Analysis of target '//runsc:runsc' failed; build aborted: Analysis failed
+INFO: Elapsed time: 14.914s
+INFO: 0 processes.
+FAILED: Build did NOT complete successfully (189 packages loaded)
+`,
+ "ERROR: Analysis of target '//runsc:runsc' failed; build aborted: Analysis failed",
+ },
} {
got := extractCauseInner([]byte(s.e))
if !bytes.Equal([]byte(s.expect), got) {