Skip to content

Commit affba2f

Browse files
committed
Fix dependencies
1. Remove PWD prefix for local dependencies (otherwise we need to specify the full path in the make targets) 2. Remove zz_generated.deepcopy.go from its prerequisites
1 parent 788a317 commit affba2f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ install-build-deps: ## Install dependencies (packages and tools)
2020

2121
##@ Build
2222

23-
godeps = $(shell go list -deps -f '{{if not .Standard}}{{ $$dep := . }}{{range .GoFiles}}{{$$dep.Dir}}/{{.}} {{end}}{{end}}' $(1))
23+
godeps_cmd = go list -deps -f '{{if not .Standard}}{{ $$dep := . }}{{range .GoFiles}}{{$$dep.Dir}}/{{.}} {{end}}{{end}}' $(1) | sed "s%${PWD}/%%g"
24+
godeps = $(shell $(call godeps_cmd,$(1)))
2425

2526
eksctl: $(call godeps,./cmd/...) ## Build main binary
2627
CGO_ENABLED=0 time go build -v -ldflags "-X $(version_pkg).gitCommit=$(git_commit) -X $(version_pkg).builtAt=$(built_at)" ./cmd/eksctl
@@ -112,9 +113,10 @@ delete-integration-test-dev-cluster: build ## Delete the test cluster for use wh
112113

113114
AWS_SDK_MOCKS := $(wildcard pkg/eks/mocks/*API.go)
114115

115-
GENERATED_FILES=pkg/addons/default/assets.go \
116+
DEEP_COPY_HELPER := pkg/apis/eksctl.io/v1alpha5/zz_generated.deepcopy.go
117+
GENERATED_FILES := pkg/addons/default/assets.go \
116118
pkg/nodebootstrap/assets.go \
117-
pkg/apis/eksctl.io/v1alpha5/zz_generated.deepcopy.go \
119+
$(DEEP_COPY_HELPER) \
118120
pkg/ami/static_resolver_ami.go \
119121
site/content/usage/20-schema.md \
120122
$(AWS_SDK_MOCKS)
@@ -138,11 +140,12 @@ pkg /nodebootstrap/assets.go: pkg/nodebootstrap/assets/*
138140
@# generate-groups.sh can't find the lincense header when using Go modules, so we provide one
139141
printf "/*\n%s\n*/\n" "$$(cat LICENSE)" > $@
140142

141-
pkg/apis/eksctl.io/v1alpha5/zz_generated.deepcopy.go: $(call godeps,./pkg/apis/...) .license-header ## Generate Kubernetes API helpers
143+
DEEP_COPY_DEPS := $(shell $(call godeps_cmd,./pkg/apis/...) | sed 's%$(DEEP_COPY_HELPER)%%' )
144+
$(DEEP_COPY_HELPER): $(DEEP_COPY_DEPS) .license-header ## Generate Kubernetes API helpers
142145
time go mod download k8s.io/code-generator # make sure the code-generator is present
143146
time env GOPATH="$$(go env GOPATH)" bash "$$(go env GOPATH)/pkg/mod/k8s.io/[email protected]/generate-groups.sh" \
144147
deepcopy,defaulter _ ./pkg/apis eksctl.io:v1alpha5 --go-header-file .license-header --output-base="$${PWD}" \
145-
|| (cat codegenheader.txt ; cat pkg/apis/eksctl.io/v1alpha5/zz_generated.deepcopy.go ; exit 1)
148+
|| (cat codegenheader.txt ; cat $(DEEP_COPY_HELPER); exit 1)
146149

147150
# static_resolver_ami.go doesn't only depend on files (it should be refreshed whenever a release is made in AWS)
148151
# so we need to forcicly generate it

0 commit comments

Comments
 (0)