From 9633c5c8a1a030cdfdc0f94ae460314c7fc15faa Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 29 Mar 2019 11:00:34 +0100 Subject: 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. --- pkg/build/build_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'pkg/build/build_test.go') 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) { -- cgit mrf-deployment