From cc115d5c278aec65ffa0bcb14acec9a6267c1a40 Mon Sep 17 00:00:00 2001 From: Mike Splain Date: Wed, 7 Mar 2018 12:13:14 -0500 Subject: [PATCH] Force bazel builds to be pure. This will compile go code with CGO_ENABLED=0 which will fix the directory structure to always being _pure_stripped no matter the compilation OS. --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index a701b39b9bbc3..a93f78ab5b538 100644 --- a/Makefile +++ b/Makefile @@ -609,21 +609,21 @@ bazel-build-cli: # Not working yet, but we can hope .PHONY: bazel-crossbuild-kops bazel-crossbuild-kops: - bazel build --experimental_platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64 //cmd/kops/... - bazel build --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/kops/... - bazel build --experimental_platforms=@io_bazel_rules_go//go/toolchain:windows_amd64 //cmd/kops/... + bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64 //cmd/kops/... + bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/kops/... + bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:windows_amd64 //cmd/kops/... .PHONY: bazel-crossbuild-nodeup bazel-crossbuild-nodeup: - bazel build --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/nodeup/... + bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/nodeup/... .PHONY: bazel-crossbuild-protokube bazel-crossbuild-protokube: - bazel build --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //protokube/... + bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //protokube/... .PHONY: bazel-crossbuild-dns-controller bazel-crossbuild-dns-controller: - bazel build --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //dns-controller/... + bazel build --features=pure --experimental_platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //dns-controller/... .PHONY: bazel-crossbuild-dns-controller-image bazel-crossbuild-dns-controller-image: @@ -689,11 +689,11 @@ bazel-version-dist: bazel-crossbuild-nodeup bazel-crossbuild-kops bazel-protokub mkdir -p ${BAZELUPLOAD}/kops/${VERSION}/darwin/amd64/ mkdir -p ${BAZELUPLOAD}/kops/${VERSION}/images/ mkdir -p ${BAZELUPLOAD}/utils/${VERSION}/linux/amd64/ - cp bazel-bin/cmd/nodeup/linux_amd64_stripped/nodeup ${BAZELUPLOAD}/kops/${VERSION}/linux/amd64/nodeup + cp bazel-bin/cmd/nodeup/linux_amd64_pure_stripped/nodeup ${BAZELUPLOAD}/kops/${VERSION}/linux/amd64/nodeup (${SHASUMCMD} ${BAZELUPLOAD}/kops/${VERSION}/linux/amd64/nodeup | cut -d' ' -f1) > ${BAZELUPLOAD}/kops/${VERSION}/linux/amd64/nodeup.sha1 cp ${BAZELIMAGES}/protokube.tar.gz ${BAZELUPLOAD}/kops/${VERSION}/images/protokube.tar.gz cp ${BAZELIMAGES}/protokube.tar.gz.sha1 ${BAZELUPLOAD}/kops/${VERSION}/images/protokube.tar.gz.sha1 - cp bazel-bin/cmd/kops/linux_amd64_stripped/kops ${BAZELUPLOAD}/kops/${VERSION}/linux/amd64/kops + cp bazel-bin/cmd/kops/linux_amd64_pure_stripped/kops ${BAZELUPLOAD}/kops/${VERSION}/linux/amd64/kops (${SHASUMCMD} ${BAZELUPLOAD}/kops/${VERSION}/linux/amd64/kops | cut -d' ' -f1) > ${BAZELUPLOAD}/kops/${VERSION}/linux/amd64/kops.sha1 cp bazel-bin/cmd/kops/darwin_amd64_pure_stripped/kops ${BAZELUPLOAD}/kops/${VERSION}/darwin/amd64/kops (${SHASUMCMD} ${BAZELUPLOAD}/kops/${VERSION}/darwin/amd64/kops | cut -d' ' -f1) > ${BAZELUPLOAD}/kops/${VERSION}/darwin/amd64/kops.sha1