From 5c25fdab080e70769307f9a61abdb2c178365d86 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 11 Jun 2020 10:34:07 +0200 Subject: sys/targets: fail loudly if SOURCEDIR_GOOS is set but compiler is broken Since we now have SOURCEDIR_{FUCHSIA,AKAROS,NETBSD} exported in the syz-big-env docker image, this will make CI fail for broken cross-builds too. Update instructions in the docker image to fix the current problem with permissions in syz-big-env: we need to tar with --mode=go=u. --- sys/targets/targets.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/targets/targets.go b/sys/targets/targets.go index bd1f5fc26..dfe699ea8 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -527,9 +527,10 @@ func (target *Target) lazyInit() { } // Only fail on CI for native build. // On CI we want to fail loudly if cross-compilation breaks. - if target.OS != runtime.GOOS || !runningOnCI { + // Also fail if SOURCEDIR_GOOS is set b/c in that case user probably assumes it will work. + if (target.OS != runtime.GOOS || !runningOnCI) && os.Getenv("SOURCEDIR_"+strings.ToUpper(target.OS)) == "" { if _, err := exec.LookPath(target.CCompiler); err != nil { - target.BrokenCompiler = fmt.Sprintf("%v is missing", target.CCompiler) + target.BrokenCompiler = fmt.Sprintf("%v is missing (%v)", target.CCompiler, err) return } } -- cgit mrf-deployment