Skip to content

Commit d94ab59

Browse files
committed
cmd/cgo/internal/testsanitizers: disable location checking for clang
Pending a resolution to #65606, this CL marks clang's ASAN runtime as unable to symbolize stack traces to unblock the LUCI clang builder. For #65606. Fixes #65469. Change-Id: I649773085aff30e5703e7f7ac2c72a0430a015c2 Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-clang15 Reviewed-on: https://go-review.googlesource.com/c/go/+/562675 Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent b158ca9 commit d94ab59

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/cmd/cgo/internal/testsanitizers/cc_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ import (
1616
"encoding/json"
1717
"errors"
1818
"fmt"
19+
"internal/testenv"
1920
"os"
2021
"os/exec"
22+
"os/user"
2123
"path/filepath"
2224
"regexp"
2325
"strconv"
@@ -266,12 +268,28 @@ func compilerSupportsLocation() bool {
266268
case "gcc":
267269
return compiler.major >= 10
268270
case "clang":
271+
// TODO(65606): The clang toolchain on the LUCI builders is not built against
272+
// zlib, the ASAN runtime can't actually symbolize its own stack trace. Once
273+
// this is resolved, one way or another, switch this back to 'true'. We still
274+
// have coverage from the 'gcc' case above.
275+
if inLUCIBuild() {
276+
return false
277+
}
269278
return true
270279
default:
271280
return false
272281
}
273282
}
274283

284+
// inLUCIBuild returns true if we're currently executing in a LUCI build.
285+
func inLUCIBuild() bool {
286+
u, err := user.Current()
287+
if err != nil {
288+
return false
289+
}
290+
return testenv.Builder() != "" && u.Username == "swarming"
291+
}
292+
275293
// compilerRequiredTsanVersion reports whether the compiler is the version required by Tsan.
276294
// Only restrictions for ppc64le are known; otherwise return true.
277295
func compilerRequiredTsanVersion(goos, goarch string) bool {

0 commit comments

Comments
 (0)