From 3b9177995e0124beb064ef8615ba9a2ae7ca4f4b Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 4 May 2022 14:17:02 +0200 Subject: vendor test tools in submodule Instead of using the main module we should vendor the test tools in a different directory. That way we do not add extra dependencies to the main module which can be problemetic for packages or other users. This is already done in buildah so this makes us more consitent. Signed-off-by: Paul Holzinger --- Makefile | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8cb6fed08..8665e9af7 100644 --- a/Makefile +++ b/Makefile @@ -136,7 +136,7 @@ endif export PATH := $(PATH):$(GOBIN):$(CURDIR)/hack -GOMD2MAN ?= $(shell command -v go-md2man || echo '$(GOBIN)/go-md2man') +GOMD2MAN ?= $(shell command -v go-md2man || echo './test/tools/build/go-md2man') CROSS_BUILD_TARGETS := \ bin/podman.cross.linux.amd64 \ @@ -232,7 +232,7 @@ endif .PHONY: .gitvalidation .gitvalidation: .gopathok @echo "Validating vs commit '$(call err_if_empty,EPOCH_TEST_COMMIT)'" - GIT_CHECK_EXCLUDE="./vendor:docs/make.bat:test/buildah-bud/buildah-tests.diff" $(GOBIN)/git-validation -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..$(HEAD) + GIT_CHECK_EXCLUDE="./vendor:docs/make.bat:test/buildah-bud/buildah-tests.diff" ./test/tools/build/git-validation -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..$(HEAD) .PHONY: lint lint: golangci-lint @@ -856,13 +856,8 @@ install.systemd: endif .PHONY: install.tools -install.tools: .install.goimports .install.gitvalidation .install.md2man .install.ginkgo .install.golangci-lint .install.bats ## Install needed tools - -.install.goimports: .gopathok - if [ ! -x "$(GOBIN)/goimports" ]; then \ - $(GO) install ./vendor/golang.org/x/tools/cmd/goimports ; \ - fi - touch .install.goimports +install.tools: .install.ginkgo .install.golangci-lint .install.bats ## Install needed tools + make -C test/tools .PHONY: .install.ginkgo .install.ginkgo: .gopathok @@ -870,16 +865,16 @@ install.tools: .install.goimports .install.gitvalidation .install.md2man .instal $(GO) install $(BUILDFLAGS) ./vendor/github.com/onsi/ginkgo/ginkgo ; \ fi -.PHONY: .install.gitvalidation -.install.gitvalidation: .gopathok - if [ ! -x "$(GOBIN)/git-validation" ]; then \ - $(GO) install ./vendor/github.com/vbatts/git-validation ; \ - fi - .PHONY: .install.golangci-lint .install.golangci-lint: .gopathok VERSION=1.45.2 GOBIN=$(GOBIN) ./hack/install_golangci.sh +.PHONY: .install.md2man +.install.md2man: + if [ ! -x "$(GOMD2MAN)" ]; then \ + make -C test/tools build/go-md2man ; \ + fi + .PHONY: .install.bats .install.bats: .gopathok VERSION=v1.1.0 ./hack/install_bats.sh @@ -890,12 +885,6 @@ install.tools: .install.goimports .install.gitvalidation .install.md2man .instal python3 -m pip install --user pre-commit; \ fi -.PHONY: .install.md2man -.install.md2man: .gopathok - if [ ! -x "$(GOMD2MAN)" ]; then \ - $(GO) install ./vendor/github.com/cpuguy83/go-md2man/v2 ; \ - fi - # $BUILD_TAGS variable is used in hack/golangci-lint.sh .PHONY: install.libseccomp.sudo install.libseccomp.sudo: -- cgit v1.2.3-54-g00ecf