dashboard/buildlet: darwin support
Update golang/go#9495
Change-Id: I732cfdee952ad3bf0b3411d0ce45723900acedb4
Reviewed-on: https://go-review.googlesource.com/2472
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/buildlet/Makefile b/buildlet/Makefile
index 6897910..61dcf36 100644
--- a/buildlet/Makefile
+++ b/buildlet/Makefile
@@ -12,3 +12,7 @@
buildlet.windows-amd64: buildlet.go
GOOS=windows GOARCH=amd64 go build -o $@ --tags=buildlet
cat $@ | (cd ../coordinator/buildongce && go run create.go --write_object=go-builder-data/$@)
+
+buildlet.darwin-amd64: buildlet.go
+ GOOS=darwin GOARCH=amd64 go build -o $@ --tags=buildlet
+ cat $@ | (cd ../coordinator/buildongce && go run create.go --write_object=go-builder-data/$@)
diff --git a/buildlet/buildlet.go b/buildlet/buildlet.go
index 3991c48..4a9047d 100644
--- a/buildlet/buildlet.go
+++ b/buildlet/buildlet.go
@@ -48,6 +48,12 @@
)
func defaultListenAddr() string {
+ if runtime.GOOS == "darwin" {
+ // Darwin will never run on GCE, so let's always
+ // listen on a high port (so we don't need to be
+ // root).
+ return ":5936"
+ }
if metadata.OnGCE() {
// In production, default to
return ":80"