mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: pass process env to 'go tool compile' in compileToAsm
In particular, this stops the test failing when GOROOT and GOROOT_FINAL are different. Change-Id: Ibf6cc0a173f1d965ee8aa31eee2698b223f1ceec Reviewed-on: https://go-review.googlesource.com/23620 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
04acd625d7
commit
2885e07c25
1 changed files with 1 additions and 1 deletions
|
|
@ -61,7 +61,7 @@ func compileToAsm(dir, arch, pkg string) string {
|
|||
|
||||
var stdout, stderr bytes.Buffer
|
||||
cmd := exec.Command("go", "tool", "compile", "-S", "-o", filepath.Join(dir, "out.o"), src)
|
||||
cmd.Env = append(cmd.Env, "GOARCH="+arch)
|
||||
cmd.Env = append([]string{"GOARCH=" + arch}, os.Environ()...)
|
||||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
if err := cmd.Run(); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue