diff --git a/Makefile b/Makefile index ba67f3323078..538c4821f350 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,6 @@ endif # * `kubernetes` run the workflow-controller and argo-server on the Kubernetes cluster RUN_MODE := local KUBECTX := $(shell [[ "`which kubectl`" != '' ]] && kubectl config current-context || echo none) -DOCKER_DESKTOP := $(shell [[ "$(KUBECTX)" == "docker-desktop" ]] && echo true || echo false) K3D := $(shell [[ "$(KUBECTX)" == "k3d-"* ]] && echo true || echo false) ifeq ($(PROFILE),prometheus) RUN_MODE := kubernetes @@ -93,7 +92,7 @@ AUTH_MODE := sso endif $(info GIT_COMMIT=$(GIT_COMMIT) GIT_BRANCH=$(GIT_BRANCH) GIT_TAG=$(GIT_TAG) GIT_TREE_STATE=$(GIT_TREE_STATE) RELEASE_TAG=$(RELEASE_TAG) DEV_BRANCH=$(DEV_BRANCH) VERSION=$(VERSION)) -$(info KUBECTX=$(KUBECTX) DOCKER_DESKTOP=$(DOCKER_DESKTOP) K3D=$(K3D) DOCKER_PUSH=$(DOCKER_PUSH) TARGET_PLATFORM=$(TARGET_PLATFORM)) +$(info KUBECTX=$(KUBECTX) K3D=$(K3D) DOCKER_PUSH=$(DOCKER_PUSH) TARGET_PLATFORM=$(TARGET_PLATFORM)) $(info RUN_MODE=$(RUN_MODE) PROFILE=$(PROFILE) AUTH_MODE=$(AUTH_MODE) SECURE=$(SECURE) STATIC_FILES=$(STATIC_FILES) ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) UPPERIO_DB_DEBUG=$(UPPERIO_DB_DEBUG) LOG_LEVEL=$(LOG_LEVEL) NAMESPACED=$(NAMESPACED)) override LDFLAGS += \ @@ -107,11 +106,14 @@ override LDFLAGS += -X github.com/argoproj/argo-workflows/v3.gitTag=${GIT_TAG} endif ifndef $(GOPATH) - GOPATH=$(shell go env GOPATH) + GOPATH:=$(shell go env GOPATH) export GOPATH endif # -- file lists +# These variables are only used as prereqs for the below targets, and we don't want to run them for other targets +# because the "go list" calls are very slow +ifneq (,$(filter dist/argoexec dist/workflow-controller dist/argo dist/argo-% docs/cli/argo.md,$(MAKECMDGOALS))) HACK_PKG_FILES_AS_PKGS ?= false ifeq ($(HACK_PKG_FILES_AS_PKGS),false) ARGOEXEC_PKG_FILES := $(shell go list -f '{{ join .Deps "\n" }}' ./cmd/argoexec/ | grep 'argoproj/argo-workflows/v3/' | xargs go list -f '{{ range $$file := .GoFiles }}{{ print $$.ImportPath "/" $$file "\n" }}{{ end }}' | cut -c 39-) @@ -124,6 +126,11 @@ else CLI_PKG_FILES := $(shell echo cmd/argo && go list -f '{{ join .Deps "\n" }}' ./cmd/argo/ | grep 'argoproj/argo-workflows/v3/' | cut -c 39-) CONTROLLER_PKG_FILES := $(shell echo cmd/workflow-controller && go list -f '{{ join .Deps "\n" }}' ./cmd/workflow-controller/ | grep 'argoproj/argo-workflows/v3/' | cut -c 39-) endif +else + ARGOEXEC_PKG_FILES := + CLI_PKG_FILES := + CONTROLLER_PKG_FILES := +endif TYPES := $(shell find pkg/apis/workflow/v1alpha1 -type f -name '*.go' -not -name openapi_generated.go -not -name '*generated*' -not -name '*test.go') CRDS := $(shell find manifests/base/crds -type f -name 'argoproj.io_*.yaml') @@ -651,6 +658,7 @@ pkg/apis/workflow/v1alpha1/openapi_generated.go: $(GOPATH)/bin/openapi-gen $(TYP # generates many other files (listers, informers, client etc). +.PRECIOUS: pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go: $(GOPATH)/bin/go-to-protobuf $(TYPES) # These files are generated on a v3/ folder by the tool. Link them to the root folder [ -e ./v3 ] || ln -s . v3