diff --git a/Makefile b/Makefile index 2c2ee16ea2..d31b1fe670 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ endif CTIMEVAR=-X $(NOTARY_PKG)/version.GitCommit=$(GITCOMMIT) -X $(NOTARY_PKG)/version.NotaryVersion=$(NOTARY_VERSION) GO_LDFLAGS=-ldflags "-w $(CTIMEVAR)" GO_LDFLAGS_STATIC=-ldflags "-w $(CTIMEVAR) -extldflags -static" -GOOSES = darwin linux +GOOSES = darwin linux windows NOTARY_BUILDTAGS ?= pkcs11 NOTARYDIR := /go/src/github.com/docker/notary diff --git a/buildscripts/circle_parallelism.sh b/buildscripts/circle_parallelism.sh index cc07fdc2d0..961d90a6ad 100755 --- a/buildscripts/circle_parallelism.sh +++ b/buildscripts/circle_parallelism.sh @@ -8,6 +8,7 @@ case $CIRCLE_NODE_INDEX in ;; 2) SKIPENVCHECK=1 make TESTDB=mysql testdb SKIPENVCHECK=1 make TESTDB=mysql integration + SKIPENVCHECK=1 make cross # just trying not to exceed 5 builders ;; 3) SKIPENVCHECK=1 make TESTDB=rethink testdb SKIPENVCHECK=1 make TESTDB=rethink integration diff --git a/buildscripts/cross.sh b/buildscripts/cross.sh index 840a751aa6..324f50081f 100755 --- a/buildscripts/cross.sh +++ b/buildscripts/cross.sh @@ -7,15 +7,9 @@ GOARCH="amd64" -if [[ "${NOTARY_BUILDTAGS}" == *pkcs11* ]]; then - export CGO_ENABLED=1 -else - export CGO_ENABLED=0 -fi - - for os in "$@"; do export GOOS="${os}" + BUILDTAGS="${NOTARY_BUILDTAGS}" if [[ "${GOOS}" == "darwin" ]]; then export CC="o64-clang" @@ -24,18 +18,28 @@ for os in "$@"; do # darwin binaries can't be compiled to be completely static with the -static flag LDFLAGS="-s" else + # no building with Cgo. Also no building with pkcs11 + if [[ "${GOOS}" == "windows" ]]; then + BUILDTAGS="" + fi unset CC unset CXX LDFLAGS="-extldflags -static" fi + if [[ "${BUILDTAGS}" == *pkcs11* ]]; then + export CGO_ENABLED=1 + else + export CGO_ENABLED=0 + fi + mkdir -p "${NOTARYDIR}/cross/${GOOS}/${GOARCH}"; set -x; go build \ -o "${NOTARYDIR}/cross/${GOOS}/${GOARCH}/notary" \ -a \ - -tags "${NOTARY_BUILDTAGS}" \ + -tags "${BUILDTAGS}" \ -ldflags "-w ${CTIMEVAR} ${LDFLAGS}" \ ./cmd/notary; set +x;