diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-06-11 10:34:07 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-06-11 18:06:49 +0200 |
| commit | 5c25fdab080e70769307f9a61abdb2c178365d86 (patch) | |
| tree | f18138e985a2f5c7996ebed7fbcaf0e6e22933e6 /sys | |
| parent | 1beaee21715b99daf89bf229213dd3ddabba6683 (diff) | |
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.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/targets/targets.go | 5 |
1 files changed, 3 insertions, 2 deletions
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 } } |
