You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/buildlet/buildlet.go
+33-73Lines changed: 33 additions & 73 deletions
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ import (
39
39
40
40
var (
41
41
haltEntireOS=flag.Bool("halt", true, "halt OS in /halt handler. If false, the buildlet process just ends.")
42
-
scratchDir=flag.String("scratchdir", "", "Temporary directory to use. The contents of this directory may be deleted at any time. If empty, TempDir is used to create one.")
42
+
workDir=flag.String("workdir", "", "Temporary directory to use. The contents of this directory may be deleted at any time. If empty, TempDir is used to create one.")
43
43
listenAddr=flag.String("listen", defaultListenAddr(), "address to listen on. Warning: this service is inherently insecure and offers no protection of its own. Do not expose this port to the world.")
44
44
)
45
45
@@ -72,33 +72,21 @@ func main() {
72
72
ifonGCE {
73
73
fixMTU()
74
74
}
75
-
ifruntime.GOOS=="plan9" {
76
-
// Plan 9 is too slow on GCE, so stop running run.rc after the basics.
77
-
// See https://golang.org/cl/2522 and https://golang.org/issue/9491
78
-
// TODO(bradfitz): once the buildlet has environment variable support,
79
-
// the coordinator can send this in, and this variable can be part of
80
-
// the build configuration struct instead of hard-coded here.
81
-
// But no need for environment variables quite yet.
82
-
os.Setenv("GOTESTONLY", "std")
83
-
}
84
-
if*scratchDir=="" {
75
+
if*workDir=="" {
85
76
dir, err:=ioutil.TempDir("", "buildlet-scatch")
86
77
iferr!=nil {
87
-
log.Fatalf("error creating scratchdir with ioutil.TempDir: %v", err)
78
+
log.Fatalf("error creating workdir with ioutil.TempDir: %v", err)
88
79
}
89
-
*scratchDir=dir
80
+
*workDir=dir
90
81
}
91
-
// TODO(bradfitz): if this becomes more of a general tool,
92
-
// perhaps we want to remove this hard-coded here. Also,
93
-
// if/once the exec handler ever gets generic environment
94
-
// variable support, it would make sense to remove this too
95
-
// and push it to the client. This hard-codes policy. But
0 commit comments