From 7c9c9fd24f0a02c137b8f438a48c2d69210bfdd1 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 21 Mar 2019 14:25:08 +0100 Subject: pkg/build: add a test for build failure root causing Such error popped up during bisection on older kernels. It's already detected properly, yet build failed with just "make failed"... Unclear why that happened, but the test won't harm. Update #501 --- pkg/build/build_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'pkg') diff --git a/pkg/build/build_test.go b/pkg/build/build_test.go index 830c4f39c..3900dfaf7 100644 --- a/pkg/build/build_test.go +++ b/pkg/build/build_test.go @@ -37,6 +37,7 @@ func TestCompilerIdentity(t *testing.T) { } func TestExtractRootCause(t *testing.T) { + // nolint: lll for _, s := range []struct{ e, expect string }{ {` cc -g -Werror db_break.c @@ -51,6 +52,20 @@ int kcov_cold = 1; `, "sys/dev/kcov.c:93:6: error: use of undeclared identifier 'kcov_cold123'; did you mean 'kcov_cold'?", }, + {` + CC /tools/objtool/parse-options.o +In file included from ./scripts/gcc-plugins/gcc-common.h:119:0, + from :1: +/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 +compilation terminated. +Cannot use CONFIG_GCC_PLUGINS: your gcc installation does not support plugins, perhaps the necessary headers are missing? +scripts/Makefile.gcc-plugins:51: recipe for target 'gcc-plugins-check' failed +make: *** [gcc-plugins-check] Error 1 +make: *** Waiting for unfinished jobs.... + UPD include/config/kernel.release +`, + "/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", + }, } { got := extractCauseInner([]byte(s.e)) if !bytes.Equal([]byte(s.expect), got) { -- cgit mrf-deployment