Skip to content

Commit 0747e65

Browse files
committed
Add -trimpath to Go build commands
1 parent 36cd4cf commit 0747e65

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,11 @@ build-all-images: $(BUILD_TARGETS)/build-operator build-utils build-test-images
438438
# Build the operator linux binary
439439
# ----------------------------------------------------------------------------------------------------------------------
440440
$(BUILD_BIN)/manager: $(BUILD_PROPS) $(GOS) $(BUILD_TARGETS)/generate $(BUILD_TARGETS)/manifests
441-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags "$(LDFLAGS)" -a -o $(BUILD_BIN)/manager main.go
441+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -trimpath -ldflags "$(LDFLAGS)" -a -o $(BUILD_BIN)/manager main.go
442442
mkdir -p $(BUILD_BIN)/linux/amd64 || true
443443
cp -f $(BUILD_BIN)/manager $(BUILD_BIN)/linux/amd64/manager
444444
mkdir -p $(BUILD_BIN)/linux/arm64 || true
445-
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -ldflags "$(LDFLAGS)" -a -o $(BUILD_BIN)/linux/arm64/manager main.go
445+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -trimpath -ldflags "$(LDFLAGS)" -a -o $(BUILD_BIN)/linux/arm64/manager main.go
446446

447447
# ----------------------------------------------------------------------------------------------------------------------
448448
# Ensure Operator SDK is at the correct version
@@ -460,11 +460,11 @@ build-runner: $(BUILD_BIN)/runner ## Build the Coherence Operator runner binary
460460

461461
$(BUILD_BIN)/runner: $(BUILD_PROPS) $(GOS)
462462
@echo "Building Operator Runner"
463-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags "$(LDFLAGS)" -o $(BUILD_BIN)/runner ./runner
463+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -trimpath -ldflags "$(LDFLAGS)" -o $(BUILD_BIN)/runner ./runner
464464
mkdir -p $(BUILD_BIN)/linux/amd64 || true
465465
cp -f $(BUILD_BIN)/runner $(BUILD_BIN)/linux/amd64/runner
466466
mkdir -p $(BUILD_BIN)/linux/arm64 || true
467-
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -ldflags "$(LDFLAGS)" -a -o $(BUILD_BIN)/linux/arm64/runner ./runner
467+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -trimpath -ldflags "$(LDFLAGS)" -a -o $(BUILD_BIN)/linux/arm64/runner ./runner
468468

469469
# ----------------------------------------------------------------------------------------------------------------------
470470
# Build the Java artifacts

0 commit comments

Comments
 (0)