aboutsummaryrefslogtreecommitdiff
path: root/go/patch/go-1.10.2/go0.patch
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2019-01-22 12:43:33 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-24 00:51:50 -0800
commit1f3c5d01027b8925ad4287d0afef4d25af165699 (patch)
tree861d7cb70171672910c21a58b0493c2dee83fbb2 /go/patch/go-1.10.2/go0.patch
parent42199fae69016e15d6840646fac13a540aeb59ce (diff)
downloadtoolchain-utils-1f3c5d01027b8925ad4287d0afef4d25af165699.tar.gz
toolchain-utils: Fix the testing patches for Go.
The Go testing instructions include applying 7 patches. The patches applied cleanly to 1.10.2, but not to any later version of Go. This CL updates that patches for the later versions of Go. BUG=chromium:924271 TEST=patches apply cleanly to their versions; re-ran tests to make sure nothing broke. Change-Id: I3ffe87876f215bfb6d37cc6a9f0fbc88325d13c1 Reviewed-on: https://chromium-review.googlesource.com/1427342 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'go/patch/go-1.10.2/go0.patch')
-rw-r--r--go/patch/go-1.10.2/go0.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/go/patch/go-1.10.2/go0.patch b/go/patch/go-1.10.2/go0.patch
new file mode 100644
index 00000000..c539865e
--- /dev/null
+++ b/go/patch/go-1.10.2/go0.patch
@@ -0,0 +1,45 @@
+testenv: look for "go" executable in path.
+
+--- src/go/build/deps_test.go
++++ src/go/build/deps_test.go
+@@ -182,17 +182,17 @@ var pkgDeps = map[string][]string{
+ "runtime/debug": {"L2", "fmt", "io/ioutil", "os", "time"},
+ "runtime/pprof": {"L2", "compress/gzip", "context", "encoding/binary", "fmt", "io/ioutil", "os", "text/tabwriter", "time"},
+ "runtime/trace": {"L0"},
+ "text/tabwriter": {"L2"},
+
+ "testing": {"L2", "flag", "fmt", "internal/race", "os", "runtime/debug", "runtime/pprof", "runtime/trace", "time"},
+ "testing/iotest": {"L2", "log"},
+ "testing/quick": {"L2", "flag", "fmt", "reflect", "time"},
+- "internal/testenv": {"L2", "OS", "flag", "testing", "syscall"},
++ "internal/testenv": {"L2", "OS", "os/exec", "flag", "testing", "syscall"},
+
+ // L4 is defined as L3+fmt+log+time, because in general once
+ // you're using L3 packages, use of fmt, log, or time is not a big deal.
+ "L4": {
+ "L3",
+ "fmt",
+ "log",
+ "time",
+--- src/internal/testenv/testenv.go
++++ src/internal/testenv/testenv.go
+@@ -43,16 +43,19 @@ func HasGoBuild() bool {
+ switch runtime.GOOS {
+ case "android", "nacl":
+ return false
+ case "darwin":
+ if strings.HasPrefix(runtime.GOARCH, "arm") {
+ return false
+ }
+ }
++ if _, err := exec.LookPath("go"); err != nil {
++ return false
++ }
+ return true
+ }
+
+ // MustHaveGoBuild checks that the current system can build programs with ``go build''
+ // and then run them with os.StartProcess or exec.Command.
+ // If not, MustHaveGoBuild calls t.Skip with an explanation.
+ func MustHaveGoBuild(t testing.TB) {
+ if os.Getenv("GO_GCFLAGS") != "" {