diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4a55986dc2..3ccc44ca9d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -61,7 +61,7 @@ jobs: with: name: src - run: tar -xvf ./src.tar.gz - - run: make build BIN=${{ matrix.bin }} + - run: make build BIN=${{ matrix.bin }} GOBORING=true docs: runs-on: ubuntu-20.04 needs: gomod diff --git a/Makefile b/Makefile index ef39f7d0fc..f79d03a203 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,8 @@ DOCS_RELEASE_BUCKET ?= s3://docs.kanister.io GITHUB_TOKEN ?= "" +GOBORING ?= "" + # If you want to build all binaries, see the 'all-build' rule. # If you want to build all containers, see the 'all-container' rule. # If you want to build AND push all containers, see the 'all-push' rule. @@ -106,6 +108,7 @@ bin/$(ARCH)/$(BIN): VERSION=$(VERSION) \ PKG=$(PKG) \ BIN=$(BIN) \ + GOBORING=$(GOBORING) \ ./build/build.sh \ "' # Example: make shell CMD="-c 'date > datefile'" diff --git a/build/build.sh b/build/build.sh index 6ad6f09acc..a10156dc49 100755 --- a/build/build.sh +++ b/build/build.sh @@ -28,7 +28,12 @@ if [ -z "${VERSION}" ]; then exit 1 fi -export CGO_ENABLED=0 +if [ -n "${GOBORING}" ]; then + export CGO_ENABLED=1 + export GO_EXTLINK_ENABLED=0 + export GOEXPERIMENT=boringcrypto +fi + go build -v \ -installsuffix "static" \ -ldflags "-X ${PKG}/pkg/version.VERSION=${VERSION}" \