]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix build failure in -x test
authorRuss Cox <rsc@golang.org>
Thu, 4 Jan 2018 20:09:21 +0000 (15:09 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 4 Jan 2018 21:55:42 +0000 (21:55 +0000)
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>
src/cmd/go/internal/work/exec.go

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