Skip to content

Commit

Permalink
build: ensure Makefile driven dependencies are up to date (#13623)
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Clucas <[email protected]>
  • Loading branch information
Joibel authored Sep 19, 2024
1 parent 9af4554 commit 4afcbc8
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ ui/dist/app/index.html: $(shell find ui/src -type f && find ui -maxdepth 1 -type
# `yarn build` is slow, so we guard it with a up-to-date check.
JOBS=max yarn --cwd ui build

$(GOPATH)/bin/staticfiles:
$(GOPATH)/bin/staticfiles: Makefile
# update this in Nix when updating it here
ifneq ($(USE_NIX), true)
go install bou.ke/staticfiles@dd04075
Expand Down Expand Up @@ -290,59 +290,59 @@ swagger: \
api/jsonschema/schema.json


$(GOPATH)/bin/mockery:
$(GOPATH)/bin/mockery: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
go install github.com/vektra/mockery/[email protected]
endif
$(GOPATH)/bin/controller-gen:
$(GOPATH)/bin/controller-gen: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
go install sigs.k8s.io/controller-tools/cmd/[email protected]
endif
$(GOPATH)/bin/go-to-protobuf:
$(GOPATH)/bin/go-to-protobuf: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
# TODO: currently fails on v0.30.3 with
# Unable to clean package k8s.io.api.core.v1: remove /home/runner/go/pkg/mod/k8s.io/[email protected]/core/v1/generated.proto: permission denied
go install k8s.io/code-generator/cmd/[email protected]
endif
$(GOPATH)/src/github.com/gogo/protobuf:
$(GOPATH)/src/github.com/gogo/protobuf: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
[ -e $(GOPATH)/src/github.com/gogo/protobuf ] || git clone --depth 1 https://github.com/gogo/protobuf.git -b v1.3.2 $(GOPATH)/src/github.com/gogo/protobuf
[ -e $@ ] || git clone --depth 1 https://github.com/gogo/protobuf.git -b v1.3.2 $@
endif
$(GOPATH)/bin/protoc-gen-gogo:
$(GOPATH)/bin/protoc-gen-gogo: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
go install github.com/gogo/protobuf/[email protected]
endif
$(GOPATH)/bin/protoc-gen-gogofast:
$(GOPATH)/bin/protoc-gen-gogofast: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
go install github.com/gogo/protobuf/[email protected]
endif
$(GOPATH)/bin/protoc-gen-grpc-gateway:
$(GOPATH)/bin/protoc-gen-grpc-gateway: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
go install github.com/grpc-ecosystem/grpc-gateway/[email protected]
endif
$(GOPATH)/bin/protoc-gen-swagger:
$(GOPATH)/bin/protoc-gen-swagger: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
go install github.com/grpc-ecosystem/grpc-gateway/[email protected]
endif
$(GOPATH)/bin/openapi-gen:
$(GOPATH)/bin/openapi-gen: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
go install k8s.io/kube-openapi/cmd/[email protected]
endif
$(GOPATH)/bin/swagger:
$(GOPATH)/bin/swagger: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
go install github.com/go-swagger/go-swagger/cmd/[email protected]
endif
$(GOPATH)/bin/goimports:
$(GOPATH)/bin/goimports: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
go install golang.org/x/tools/cmd/[email protected]
Expand All @@ -354,7 +354,7 @@ ifeq ($(shell uname),Darwin)
brew install clang-format
else
sudo apt update
sudo apt install clang-format
sudo apt install -y clang-format
endif
endif

Expand Down Expand Up @@ -445,7 +445,7 @@ dist/manifests/%: manifests/%

# lint/test/etc

$(GOPATH)/bin/golangci-lint:
$(GOPATH)/bin/golangci-lint: Makefile
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.61.0

.PHONY: lint
Expand Down Expand Up @@ -523,7 +523,7 @@ dist/argosay:
cp test/e2e/images/argosay/v2/argosay dist/

.PHONY: kit
kit:
kit: Makefile
ifeq ($(shell command -v kit),)
ifeq ($(shell uname),Darwin)
brew tap kitproj/kit --custom-remote https://github.com/kitproj/kit
Expand Down Expand Up @@ -637,9 +637,11 @@ pkg/apis/workflow/v1alpha1/zz_generated.deepcopy.go: $(TYPES)
# Delete the link
[ -e ./v3 ] && rm -rf v3

dist/kubernetes.swagger.json:
dist/kubernetes.swagger.json: Makefile
@mkdir -p dist
./hack/recurl.sh dist/kubernetes.swagger.json https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.3/api/openapi-spec/swagger.json
# recurl will only fetch if the file doesn't exist, so delete it
rm -f $@
./hack/recurl.sh $@ https://raw.githubusercontent.com/kubernetes/kubernetes/v1.30.3/api/openapi-spec/swagger.json

pkg/apiclient/_.secondary.swagger.json: hack/api/swagger/secondaryswaggergen.go pkg/apis/workflow/v1alpha1/openapi_generated.go dist/kubernetes.swagger.json
rm -Rf v3 vendor
Expand Down Expand Up @@ -684,7 +686,7 @@ docs/cli/argo.md: $(CLI_PKG_FILES) go.sum server/static/files.go hack/docs/cli.g

# docs

/usr/local/bin/mdspell:
/usr/local/bin/mdspell: Makefile
# update this in Nix when upgrading it here
ifneq ($(USE_NIX), true)
npm list -g [email protected] > /dev/null || npm i -g [email protected]
Expand Down

0 comments on commit 4afcbc8

Please sign in to comment.