From 47646d42a25ce15f4d5265baa4e51a11252a93ed Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 7 Jan 2015 14:08:28 -0800 Subject: [PATCH] dashboard/buildlet: darwin support Update golang/go#9495 Change-Id: I732cfdee952ad3bf0b3411d0ce45723900acedb4 Reviewed-on: https://go-review.googlesource.com/2472 Reviewed-by: Andrew Gerrand --- dashboard/buildlet/Makefile | 4 ++++ dashboard/buildlet/buildlet.go | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/dashboard/buildlet/Makefile b/dashboard/buildlet/Makefile index 68979104..61dcf36b 100644 --- a/dashboard/buildlet/Makefile +++ b/dashboard/buildlet/Makefile @@ -12,3 +12,7 @@ buildlet.plan9-386: buildlet.go 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/dashboard/buildlet/buildlet.go b/dashboard/buildlet/buildlet.go index 3991c48e..4a9047d4 100644 --- a/dashboard/buildlet/buildlet.go +++ b/dashboard/buildlet/buildlet.go @@ -48,6 +48,12 @@ var ( ) 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"