diff options
Diffstat (limited to 'meta/recipes-devtools/go/go-1.13/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch')
-rw-r--r-- | meta/recipes-devtools/go/go-1.13/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.13/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/meta/recipes-devtools/go/go-1.13/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch new file mode 100644 index 0000000000..9aa0119ae9 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.13/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From 28ada8896b76d620240bafc22aa395071d601482 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alex Kube <alexander.j.kube@gmail.com> | ||
3 | Date: Wed, 23 Oct 2019 21:15:37 +0430 | ||
4 | Subject: [PATCH 3/9] cmd/go: Allow GOTOOLDIR to be overridden in the environment | ||
5 | |||
6 | to allow for split host/target build roots | ||
7 | |||
8 | Adapted to Go 1.13 from patches originally submitted to | ||
9 | the meta/recipes-devtools/go tree by | ||
10 | Matt Madison <matt@madison.systems>. | ||
11 | |||
12 | Upstream-Status: Inappropriate [OE specific] | ||
13 | |||
14 | Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> | ||
15 | --- | ||
16 | src/cmd/dist/build.go | 4 +++- | ||
17 | src/cmd/go/internal/cfg/cfg.go | 6 +++++- | ||
18 | 2 files changed, 8 insertions(+), 2 deletions(-) | ||
19 | |||
20 | diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go | ||
21 | index 9e50311..683ca6f 100644 | ||
22 | --- a/src/cmd/dist/build.go | ||
23 | +++ b/src/cmd/dist/build.go | ||
24 | @@ -244,7 +244,9 @@ func xinit() { | ||
25 | workdir = xworkdir() | ||
26 | xatexit(rmworkdir) | ||
27 | |||
28 | - tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) | ||
29 | + if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { | ||
30 | + tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) | ||
31 | + } | ||
32 | } | ||
33 | |||
34 | // compilerEnv returns a map from "goos/goarch" to the | ||
35 | diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go | ||
36 | index a3277a6..db96350 100644 | ||
37 | --- a/src/cmd/go/internal/cfg/cfg.go | ||
38 | +++ b/src/cmd/go/internal/cfg/cfg.go | ||
39 | @@ -60,7 +60,11 @@ func defaultContext() build.Context { | ||
40 | // variables. This matches the initialization of ToolDir in | ||
41 | // go/build, except for using ctxt.GOROOT rather than | ||
42 | // runtime.GOROOT. | ||
43 | - build.ToolDir = filepath.Join(ctxt.GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) | ||
44 | + if s := os.Getenv("GOTOOLDIR"); s != "" { | ||
45 | + build.ToolDir = filepath.Clean(s) | ||
46 | + } else { | ||
47 | + build.ToolDir = filepath.Join(ctxt.GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) | ||
48 | + } | ||
49 | } | ||
50 | |||
51 | ctxt.GOPATH = envOr("GOPATH", ctxt.GOPATH) | ||
52 | -- | ||
53 | 2.17.1 (Apple Git-112) | ||
54 | |||