From 6492569277c348a4d5963d915410feda489d2f95 Mon Sep 17 00:00:00 2001 From: Jeff Grafton Date: Thu, 29 Sep 2016 16:33:30 -0700 Subject: [PATCH] Use patched go1.7.1 for cross-builds targeting darwin --- build/build-image/cross/Dockerfile | 4 +++- build/build-image/cross/VERSION | 2 +- hack/lib/golang.sh | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/build-image/cross/Dockerfile b/build/build-image/cross/Dockerfile index c6d58ab3092d1..8f5c117abec36 100644 --- a/build/build-image/cross/Dockerfile +++ b/build/build-image/cross/Dockerfile @@ -84,9 +84,11 @@ ENV K8S_PATCHED_GOLANG_VERSION=1.7.1 \ RUN mkdir -p ${K8S_PATCHED_GOROOT} \ && curl -sSL https://github.com/golang/go/archive/go${K8S_PATCHED_GOLANG_VERSION}.tar.gz | tar -xz -C ${K8S_PATCHED_GOROOT} --strip-components=1 +# We need a patched go1.7.1 for linux/arm (https://github.com/kubernetes/kubernetes/issues/29904) +# We need go1.7.1 for all darwin builds (https://github.com/kubernetes/kubernetes/issues/32999) COPY golang-patches/CL28857-go1.7.1-luxas.patch ${K8S_PATCHED_GOROOT}/ RUN cd ${K8S_PATCHED_GOROOT} \ && patch -p1 < CL28857-go1.7.1-luxas.patch \ && cd src \ && GOROOT_FINAL=${K8S_PATCHED_GOROOT} GOROOT_BOOTSTRAP=/usr/local/go ./make.bash \ - && for platform in linux/arm; do GOOS=${platform%/*} GOARCH=${platform##*/} GOROOT=${K8S_PATCHED_GOROOT} go install std; done + && for platform in linux/arm darwin/386 darwin/amd64; do GOOS=${platform%/*} GOARCH=${platform##*/} GOROOT=${K8S_PATCHED_GOROOT} go install std; done diff --git a/build/build-image/cross/VERSION b/build/build-image/cross/VERSION index acfa60134b084..23f60f9010d30 100644 --- a/build/build-image/cross/VERSION +++ b/build/build-image/cross/VERSION @@ -1 +1 @@ -v1.6.3-7 +v1.6.3-8 diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index c0b5f54451179..aa0e0d2d8be04 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -248,6 +248,7 @@ kube::golang::set_platform_envs() { if [[ ${platform} == "linux/arm" ]]; then export CGO_ENABLED=1 export CC=arm-linux-gnueabi-gcc + # See https://github.com/kubernetes/kubernetes/issues/29904 export GOROOT=${K8S_PATCHED_GOROOT} elif [[ ${platform} == "linux/arm64" ]]; then export CGO_ENABLED=1 @@ -255,6 +256,9 @@ kube::golang::set_platform_envs() { elif [[ ${platform} == "linux/ppc64le" ]]; then export CGO_ENABLED=1 export CC=powerpc64le-linux-gnu-gcc + elif [[ ${platform} == "darwin/"* ]]; then + # See https://github.com/kubernetes/kubernetes/issues/32999 + export GOROOT=${K8S_PATCHED_GOROOT} fi fi }