mirror of
https://github.com/golang/go
synced 2024-11-25 04:57:56 -07:00
misc/dashboard/builder: use c:\ as default buildroot on windows
We have some tests (misc/cgo/test) that are disabled only because they will fail to run on go builder - see issue 3358 for details. This change will allow us to enable these tests. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6493118
This commit is contained in:
parent
ab7c8a6200
commit
db3c800d19
@ -46,7 +46,7 @@ type Builder struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
buildroot = flag.String("buildroot", filepath.Join(os.TempDir(), "gobuilder"), "Directory under which to build")
|
buildroot = flag.String("buildroot", defaultBuildRoot(), "Directory under which to build")
|
||||||
commitFlag = flag.Bool("commit", false, "upload information about new commits")
|
commitFlag = flag.Bool("commit", false, "upload information about new commits")
|
||||||
dashboard = flag.String("dashboard", "build.golang.org", "Go Dashboard Host")
|
dashboard = flag.String("dashboard", "build.golang.org", "Go Dashboard Host")
|
||||||
buildRelease = flag.Bool("release", false, "Build and upload binary release archives")
|
buildRelease = flag.Bool("release", false, "Build and upload binary release archives")
|
||||||
@ -668,6 +668,19 @@ func defaultSuffix() string {
|
|||||||
return ".bash"
|
return ".bash"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// defaultBuildRoot returns default buildroot directory.
|
||||||
|
func defaultBuildRoot() string {
|
||||||
|
var d string
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
// will use c:\, otherwise absolute paths become too long
|
||||||
|
// during builder run, see http://golang.org/issue/3358.
|
||||||
|
d = `c:\`
|
||||||
|
} else {
|
||||||
|
d = os.TempDir()
|
||||||
|
}
|
||||||
|
return filepath.Join(d, "gobuilder")
|
||||||
|
}
|
||||||
|
|
||||||
func getenvOk(k string) (v string, ok bool) {
|
func getenvOk(k string) (v string, ok bool) {
|
||||||
v = os.Getenv(k)
|
v = os.Getenv(k)
|
||||||
if v != "" {
|
if v != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user