diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-20 10:49:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 10:49:20 -0500 |
commit | d6711a2929576bcda41e6b07a12fa309db56ba5d (patch) | |
tree | b46d046e20257b5870352f85c0bf29c68e90835b | |
parent | 7d024a2fc8c675e4d34e3b34b56b6217a48ef9ce (diff) | |
parent | a3621a7cff27a77a53031cd58b2015a0f178101b (diff) | |
download | podman-d6711a2929576bcda41e6b07a12fa309db56ba5d.tar.gz podman-d6711a2929576bcda41e6b07a12fa309db56ba5d.tar.bz2 podman-d6711a2929576bcda41e6b07a12fa309db56ba5d.zip |
Merge pull request #9020 from vrothberg/fix-9000
make bindings generation more robust
-rw-r--r-- | .cirrus.yml | 14 | ||||
-rw-r--r-- | Makefile | 14 | ||||
-rwxr-xr-x | contrib/cirrus/runner.sh | 6 | ||||
-rwxr-xr-x | contrib/cirrus/setup_environment.sh | 2 |
4 files changed, 20 insertions, 16 deletions
diff --git a/.cirrus.yml b/.cirrus.yml index bfe293601..2aa751f9f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -274,17 +274,19 @@ swagger_task: # Check that all included go modules from other sources match -# what is expected in `vendor/modules.txt` vs `go.mod`. -vendor_task: - name: "Test Vendoring" - alias: vendor +# what is expected in `vendor/modules.txt` vs `go.mod`. Also +# make sure that the generated bindings in pkg/bindings/... +# are in sync with the code. +consistency_task: + name: "Test Code Consistency" + alias: consistency skip: *tags depends_on: - build container: *smallcontainer env: <<: *stdenvars - TEST_FLAVOR: vendor + TEST_FLAVOR: consistency TEST_ENVIRON: container CTR_FQIN: ${FEDORA_CONTAINER_FQIN} clone_script: *full_clone # build-cache not available to container tasks @@ -642,7 +644,7 @@ success_task: - validate - bindings - swagger - - vendor + - consistency - alt_build - static_alt_build - osx_alt_build @@ -86,7 +86,7 @@ PODMAN_SERVER_LOG ?= # If GOPATH not specified, use one in the local directory ifeq ($(GOPATH),) -export GOPATH := $(CURDIR)/_output +export GOPATH := $(HOME)/go unexport GOBIN endif FIRST_GOPATH := $(firstword $(subst :, ,$(GOPATH))) @@ -98,6 +98,8 @@ ifeq ($(GOBIN),) GOBIN := $(FIRST_GOPATH)/bin endif +export PATH := $(PATH):$(GOBIN) + GOMD2MAN ?= $(shell command -v go-md2man || echo '$(GOBIN)/go-md2man') CROSS_BUILD_TARGETS := \ @@ -206,7 +208,7 @@ endif podman: bin/podman .PHONY: bin/podman-remote -bin/podman-remote: .gopathok .generate-bindings $(SOURCES) go.mod go.sum ## Build with podman on remote environment +bin/podman-remote: .gopathok $(SOURCES) go.mod go.sum ## Build with podman on remote environment $(GO) build $(BUILDFLAGS) -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "${REMOTETAGS}" -o $@ ./cmd/podman .PHONY: bin/podman-remote-static @@ -277,7 +279,6 @@ clean: ## Clean artifacts libpod/container_easyjson.go \ libpod/pod_easyjson.go \ .install.goimports \ - .generate-bindings \ docs/build make -C docs clean @@ -463,12 +464,11 @@ podman-remote-%-release: rm -f release.txt $(MAKE) podman-remote-release-$*.zip -BINDINGS_SOURCE = $(wildcard pkg/bindings/**/types.go) -.generate-bindings: $(BINDINGS_SOURCE) +.PHONY: generate-bindings +generate-bindings: ifneq ($(shell uname -s), Darwin) - $(GO) generate -mod=vendor ./pkg/bindings/... ; + GO111MODULE=off $(GO) generate ./pkg/bindings/... ; endif - touch .generate-bindings .PHONY: docker-docs docker-docs: docs diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh index e968fac45..d9f91c7af 100755 --- a/contrib/cirrus/runner.sh +++ b/contrib/cirrus/runner.sh @@ -146,9 +146,11 @@ function _run_swagger() { cp -v $GOSRC/pkg/api/swagger.yaml $GOSRC/ } -function _run_vendor() { +function _run_consistency() { make vendor - ./hack/tree_status.sh + SUGGESTION="run 'make vendor' and commit all changes" ./hack/tree_status.sh + make generate-bindings + SUGGESTION="run 'make generate-bindings' and commit all changes" ./hack/tree_status.sh } function _run_build() { diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh index 5c6f05ac0..7b49caba0 100755 --- a/contrib/cirrus/setup_environment.sh +++ b/contrib/cirrus/setup_environment.sh @@ -214,7 +214,7 @@ case "$TEST_FLAVOR" in install_test_configs ;; - vendor) make clean ;; + consistency) make clean ;; release) ;; *) die_unknown TEST_FLAVOR esac |