From a4e9bdfb20b340583fa4a101f49e368ec45996e4 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 4 Sep 2014 14:52:34 -0700 Subject: [PATCH] dashboard/builder: set correct path to gcc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise when running -386 and -amd64 on the same machine with both copies of TDM-GCC installed (the installer wizard lets you choose which one, and you can do both options in two different install attemps), one previously got this error when using the 64-bit gcc with a 386 build: --- FAIL: TestStdcallAndCDeclCallbacks (0.12s) panic: Failed to load C:\Users\WINDOW~1\AppData\Local\Temp\1\TestCDeclCallback960696761\test.dll: %1 is not a valid Win32 application. [recovered] panic: Failed to load C:\Users\WINDOW~1\AppData\Local\Temp\1\TestCDeclCallback960696761\test.dll: %1 is not a valid Win32 application. goroutine 81490 [running]: runtime.panic(0x5b8c00, 0x1390d4e0) c:/gobuilder/windows-386-gce-b24422c8828f/go/src/pkg/runtime/panic.c:130 +0xed fp=0x12d99f78 sp=0x12d99f24 testing.funcĀ·006() c:/go/src/pkg/testing/testing.go:421 +0x147 fp=0x12d99fd0 sp=0x12d99f78 ----- stack segment boundary ----- runtime.panic(0x5b8c00, 0x1390d4e0) c:/gobuilder/windows-386-gce-b24422c8828f/go/src/pkg/runtime/panic.c:98 +0x17a fp=0x12155e98 sp=0x12155e44 syscall.MustLoadDLL(0x1390b7c0, 0x4a, 0x2) c:/go/src/pkg/syscall/dll_windows.go:62 +0x6c fp=0x12155eb8 sp=0x12155e98 runtime_test.(*cbTest).run(0x12155f24, 0x1213cc00, 0x1390b7c0, 0x4a) c:/gobuilder/windows-386-gce-b24422c8828f/go/src/pkg/runtime/syscall_windows_test.go:399 +0x36 fp=0x12155ef4 sp=0x12155eb8 runtime_test.TestStdcallAndCDeclCallbacks(0x1213cc00) c:/gobuilder/windows-386-gce-b24422c8828f/go/src/pkg/runtime/syscall_windows_test.go:448 +0x28e fp=0x12155fac sp=0x12155ef4 TBR=cmang R=cmang CC=adg, golang-codereviews https://golang.org/cl/141070043 --- dashboard/builder/env.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dashboard/builder/env.go b/dashboard/builder/env.go index 554d25f5..8d104653 100644 --- a/dashboard/builder/env.go +++ b/dashboard/builder/env.go @@ -83,6 +83,14 @@ func (b *Builder) envvWindows() []string { start[name] = s } } + if b.goos == "windows" { + switch b.goarch { + case "amd64": + start["PATH"] = `c:\TDM-GCC-64\bin;` + start["PATH"] + case "386": + start["PATH"] = `c:\TDM-GCC-32\bin;` + start["PATH"] + } + } skip := map[string]bool{ "GOBIN": true, "GOPATH": true,