go.tools/dashboard/builder: always cross compile for nacl builds

If we are building, for example, linux/386 on a linux/amd64 machine we want to make sure that the whole build is done as a if this were compiled on a real linux/386 machine. In other words, we want to not do a cross compilation build.

The exception to this rule is when we are doing nacl builds. These are by definition always cross compilation, and we have support built into cmd/go to be able to handle this case.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/74230043
This commit is contained in:
Dave Cheney 2014-03-12 09:52:02 +11:00
Родитель f855b39288
Коммит b8df7ea2b0
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -54,11 +54,20 @@ func (b *Builder) envv() []string {
if *buildTool == "go" {
e = []string{
"GOOS=" + b.goos,
"GOHOSTOS=" + b.goos,
"GOARCH=" + b.goarch,
"GOHOSTARCH=" + b.goarch,
"GOROOT_FINAL=/usr/local/go",
}
if b.goos != "nacl" {
// If we are building, for example, linux/386 on a linux/amd64 machine we want to
// make sure that the whole build is done as a if this were compiled on a real
// linux/386 machine. In other words, we want to not do a cross compilation build.
// To do this we set GOHOSTOS and GOHOSTARCH to override the detection in make.bash.
//
// The exception to this rule is when we are doing nacl builds. These are by definition
// always cross compilation, and we have support built into cmd/go to be able to handle
// this case.
e = append(e, "GOHOSTOS="+b.goos, "GOHOSTARCH="+b.goarch)
}
}
for _, k := range extraEnv {