Skip to content

Commit

Permalink
[EPMDEDP-10411]: chore: Add gcflags for go build artifact
Browse files Browse the repository at this point in the history
Remove prefix from recorded source file paths

Change-Id: Ic681d500d01421a375013a9748ae663002665ff7
  • Loading branch information
MykolaMarusenko committed Aug 12, 2022
1 parent 811445b commit ed1beeb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ override LDFLAGS += \
-X ${PACKAGE}.version=${VERSION} \
-X ${PACKAGE}.buildDate=${BUILD_DATE} \
-X ${PACKAGE}.gitCommit=${GIT_COMMIT} \
-X ${PACKAGE}.kubectlVersion=${KUBECTL_VERSION}\
-X ${PACKAGE}.kubectlVersion=${KUBECTL_VERSION}

ifneq (${GIT_TAG},)
LDFLAGS += -X ${PACKAGE}.gitTag=${GIT_TAG}
endif

override GCFLAGS +=all=-trimpath=${CURRENT_DIR}

.DEFAULT_GOAL:=help
# set default shell
SHELL=/bin/bash -o pipefail -o errexit
Expand Down Expand Up @@ -56,7 +58,7 @@ lint: ## Run go lint

.PHONY: build
build: clean ## build operator's binary
CGO_ENABLED=0 GOOS=${HOST_OS} GOARCH=${HOST_ARCH} go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${BIN_NAME} ./cmd/manager/main.go
CGO_ENABLED=0 GOOS=${HOST_OS} GOARCH=${HOST_ARCH} go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${BIN_NAME} -gcflags '${GCFLAGS}' ./cmd/manager/main.go

.PHONY: clean
clean: ## clean up
Expand Down

0 comments on commit ed1beeb

Please sign in to comment.