1
0
mirror of https://github.com/golang/go synced 2024-10-02 16:28:34 -06:00

cmd/go: fix build failure in -x test

CL 84735 strengthened the -x test to make sure commands succeed,
using set -e, but the gcc flag tests can fail. Change them to say || true.

Fixes #23337.

Change-Id: I01e4017cb36ceb147b56935c2636de52ce7bdfdb
Reviewed-on: https://go-review.googlesource.com/86239
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Russ Cox 2018-01-04 15:09:21 -05:00
parent 100bd43f5c
commit a6b938549e

View File

@ -1799,7 +1799,7 @@ func (b *Builder) gccSupportsFlag(compiler []string, flag string) bool {
// GCC and clang. // GCC and clang.
cmdArgs := str.StringList(compiler, flag, "-c", "-x", "c", "-") cmdArgs := str.StringList(compiler, flag, "-c", "-x", "c", "-")
if cfg.BuildN || cfg.BuildX { if cfg.BuildN || cfg.BuildX {
b.Showcmd(b.WorkDir, "%s", joinUnambiguously(cmdArgs)) b.Showcmd(b.WorkDir, "%s || true", joinUnambiguously(cmdArgs))
if cfg.BuildN { if cfg.BuildN {
return false return false
} }