xref: /aosp_15_r20/external/toolchain-utils/go/patch/go-1.10.2/go0.patch (revision 760c253c1ed00ce9abd48f8546f08516e57485fe)
1*760c253cSXin Litestenv: look for "go" executable in path.
2*760c253cSXin Li
3*760c253cSXin Li--- src/go/build/deps_test.go
4*760c253cSXin Li+++ src/go/build/deps_test.go
5*760c253cSXin Li@@ -182,17 +182,17 @@ var pkgDeps = map[string][]string{
6*760c253cSXin Li 	"runtime/debug":  {"L2", "fmt", "io/ioutil", "os", "time"},
7*760c253cSXin Li 	"runtime/pprof":  {"L2", "compress/gzip", "context", "encoding/binary", "fmt", "io/ioutil", "os", "text/tabwriter", "time"},
8*760c253cSXin Li 	"runtime/trace":  {"L0"},
9*760c253cSXin Li 	"text/tabwriter": {"L2"},
10*760c253cSXin Li
11*760c253cSXin Li 	"testing":          {"L2", "flag", "fmt", "internal/race", "os", "runtime/debug", "runtime/pprof", "runtime/trace", "time"},
12*760c253cSXin Li 	"testing/iotest":   {"L2", "log"},
13*760c253cSXin Li 	"testing/quick":    {"L2", "flag", "fmt", "reflect", "time"},
14*760c253cSXin Li-	"internal/testenv": {"L2", "OS", "flag", "testing", "syscall"},
15*760c253cSXin Li+	"internal/testenv": {"L2", "OS", "os/exec", "flag", "testing", "syscall"},
16*760c253cSXin Li
17*760c253cSXin Li 	// L4 is defined as L3+fmt+log+time, because in general once
18*760c253cSXin Li 	// you're using L3 packages, use of fmt, log, or time is not a big deal.
19*760c253cSXin Li 	"L4": {
20*760c253cSXin Li 		"L3",
21*760c253cSXin Li 		"fmt",
22*760c253cSXin Li 		"log",
23*760c253cSXin Li 		"time",
24*760c253cSXin Li--- src/internal/testenv/testenv.go
25*760c253cSXin Li+++ src/internal/testenv/testenv.go
26*760c253cSXin Li@@ -43,16 +43,19 @@ func HasGoBuild() bool {
27*760c253cSXin Li 	switch runtime.GOOS {
28*760c253cSXin Li 	case "android", "nacl":
29*760c253cSXin Li 		return false
30*760c253cSXin Li 	case "darwin":
31*760c253cSXin Li 		if strings.HasPrefix(runtime.GOARCH, "arm") {
32*760c253cSXin Li 			return false
33*760c253cSXin Li 		}
34*760c253cSXin Li 	}
35*760c253cSXin Li+	if _, err := exec.LookPath("go"); err != nil {
36*760c253cSXin Li+		return false
37*760c253cSXin Li+	}
38*760c253cSXin Li 	return true
39*760c253cSXin Li }
40*760c253cSXin Li
41*760c253cSXin Li // MustHaveGoBuild checks that the current system can build programs with ``go build''
42*760c253cSXin Li // and then run them with os.StartProcess or exec.Command.
43*760c253cSXin Li // If not, MustHaveGoBuild calls t.Skip with an explanation.
44*760c253cSXin Li func MustHaveGoBuild(t testing.TB) {
45*760c253cSXin Li 	if os.Getenv("GO_GCFLAGS") != "" {
46