Skip to content

Commit 397ea59

Browse files
authored
Allow turning off go's buildvcs (#743)
Signed-off-by: Marc Khouzam <marc.khouzam@broadcom.com>
1 parent 189edb8 commit 397ea59

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ GO := go
2929

3030
GOTEST_VERBOSE ?= -v
3131

32+
# Allow turning off go's vcs build
33+
BUILDVCS ?= true
34+
3235
# Directories
3336
TOOLS_DIR := $(abspath $(ROOT_DIR)/hack/tools)
3437
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
@@ -144,9 +147,9 @@ build-cli-%: ##Build the Tanzu Core CLI for a platform
144147
fi
145148

146149
@if [ "$(OS)" = "windows" ]; then \
147-
GOOS=$(OS) GOARCH=$(ARCH) $(GO) build -gcflags=all="-l" --ldflags "$(LD_FLAGS)" -o "$(ARTIFACTS_DIR)/$(OS)/$(ARCH)/cli/core/$(BUILD_VERSION)/tanzu-cli-$(OS)_$(ARCH).exe" ./cmd/tanzu/main.go;\
150+
GOOS=$(OS) GOARCH=$(ARCH) $(GO) build -buildvcs=$(BUILDVCS) -gcflags=all="-l" --ldflags "$(LD_FLAGS)" -o "$(ARTIFACTS_DIR)/$(OS)/$(ARCH)/cli/core/$(BUILD_VERSION)/tanzu-cli-$(OS)_$(ARCH).exe" ./cmd/tanzu/main.go;\
148151
else \
149-
GOOS=$(OS) GOARCH=$(ARCH) $(GO) build -gcflags=all="-l" --ldflags "$(LD_FLAGS)" -o "$(ARTIFACTS_DIR)/$(OS)/$(ARCH)/cli/core/$(BUILD_VERSION)/tanzu-cli-$(OS)_$(ARCH)" ./cmd/tanzu/main.go;\
152+
GOOS=$(OS) GOARCH=$(ARCH) $(GO) build -buildvcs=$(BUILDVCS) -gcflags=all="-l" --ldflags "$(LD_FLAGS)" -o "$(ARTIFACTS_DIR)/$(OS)/$(ARCH)/cli/core/$(BUILD_VERSION)/tanzu-cli-$(OS)_$(ARCH)" ./cmd/tanzu/main.go;\
150153
fi
151154

152155
## --------------------------------------
@@ -155,7 +158,7 @@ build-cli-%: ##Build the Tanzu Core CLI for a platform
155158

156159
.PHONY: prepare-builder
157160
prepare-builder: ## Build Tanzu CLI builder plugin
158-
cd cmd/plugin/builder && $(GO) build -o $(ROOT_DIR)/bin/builder .
161+
cd cmd/plugin/builder && $(GO) build -buildvcs=$(BUILDVCS) -o $(ROOT_DIR)/bin/builder .
159162

160163
## --------------------------------------
161164
## OS Packages

0 commit comments

Comments
 (0)