From 3b93a8e0034a8109125737a9019e6e787f81ec2b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 29 Apr 2020 15:31:23 +0200 Subject: sys/targets: better detection for missing/broken cross-compilers 1. Detect when compiler is present, but is not functioning (can't build a simple program, common for Linux distros). 2. Be more strict with skipping tests due to missing/broken compilers on CI (on CI they should work, so fail loudly if not). 3. Dedup this logic across syz-env and pkg/csource tests. 4. Add better error reporting for syz-env. Fixes #1606 --- pkg/csource/csource_test.go | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'pkg/csource/csource_test.go') diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go index 59ca230b6..78145c8fa 100644 --- a/pkg/csource/csource_test.go +++ b/pkg/csource/csource_test.go @@ -8,7 +8,6 @@ import ( "io/ioutil" "math/rand" "os" - "os/exec" "path/filepath" "regexp" "runtime" @@ -33,26 +32,9 @@ func TestGenerate(t *testing.T) { continue } t.Run(target.OS+"/"+target.Arch, func(t *testing.T) { - if target.OS == "linux" && target.Arch == "arm64" { - // Episodically fails on travis with: - // collect2: error: ld terminated with signal 11 [Segmentation fault] - t.Skip("broken") - } - if target.OS == "test" && target.PtrSize == 4 { - // The same reason as linux/32. - t.Skip("broken") - } - if _, err := exec.LookPath(sysTarget.CCompiler); err != nil { - t.Skipf("no target compiler %v", sysTarget.CCompiler) - } - bin, err := Build(target, []byte(` -#include -int main() { printf("Hello, World!\n"); } -`)) - if err != nil { + if err := sysTarget.BrokenCrossCompiler; err != "" { t.Skipf("target compiler is broken: %v", err) } - os.Remove(bin) full := !checked[target.OS] checked[target.OS] = true t.Parallel() -- cgit mrf-deployment