Skip to content

Commit ba78328

Browse files
committed
feat: add bunch of ldflags for reproducibility
Signed-off-by: Batuhan Apaydın <[email protected]>
1 parent 659b03f commit ba78328

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ else
1313
BUILD_DATE ?= $(shell date $(DATE_FMT))
1414
endif
1515
PKG=github.com/hashicorp/vault-csi-provider/internal/version
16-
LDFLAGS?="-X '$(PKG).BuildVersion=$(VERSION)' \
16+
LDFLAGS?="-s -w -extldflags=-zrelro -extldflags=-znow -X '$(PKG).BuildVersion=$(VERSION)' \
1717
-X '$(PKG).BuildDate=$(BUILD_DATE)' \
1818
-X '$(PKG).GoVersion=$(shell go version)'"
1919
K8S_VERSION?=v1.22.2
@@ -41,6 +41,7 @@ lint:
4141

4242
build:
4343
CGO_ENABLED=0 go build \
44+
-trimpath \
4445
-ldflags $(LDFLAGS) \
4546
-o dist/ \
4647
.

0 commit comments

Comments
 (0)