mirror of
https://github.com/containers/podman.git
synced 2025-06-24 19:42:56 +08:00
Merge pull request #9020 from vrothberg/fix-9000
make bindings generation more robust
This commit is contained in:
14
.cirrus.yml
14
.cirrus.yml
@ -274,17 +274,19 @@ swagger_task:
|
|||||||
|
|
||||||
|
|
||||||
# Check that all included go modules from other sources match
|
# Check that all included go modules from other sources match
|
||||||
# what is expected in `vendor/modules.txt` vs `go.mod`.
|
# what is expected in `vendor/modules.txt` vs `go.mod`. Also
|
||||||
vendor_task:
|
# make sure that the generated bindings in pkg/bindings/...
|
||||||
name: "Test Vendoring"
|
# are in sync with the code.
|
||||||
alias: vendor
|
consistency_task:
|
||||||
|
name: "Test Code Consistency"
|
||||||
|
alias: consistency
|
||||||
skip: *tags
|
skip: *tags
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
container: *smallcontainer
|
container: *smallcontainer
|
||||||
env:
|
env:
|
||||||
<<: *stdenvars
|
<<: *stdenvars
|
||||||
TEST_FLAVOR: vendor
|
TEST_FLAVOR: consistency
|
||||||
TEST_ENVIRON: container
|
TEST_ENVIRON: container
|
||||||
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
|
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
|
||||||
clone_script: *full_clone # build-cache not available to container tasks
|
clone_script: *full_clone # build-cache not available to container tasks
|
||||||
@ -642,7 +644,7 @@ success_task:
|
|||||||
- validate
|
- validate
|
||||||
- bindings
|
- bindings
|
||||||
- swagger
|
- swagger
|
||||||
- vendor
|
- consistency
|
||||||
- alt_build
|
- alt_build
|
||||||
- static_alt_build
|
- static_alt_build
|
||||||
- osx_alt_build
|
- osx_alt_build
|
||||||
|
14
Makefile
14
Makefile
@ -86,7 +86,7 @@ PODMAN_SERVER_LOG ?=
|
|||||||
|
|
||||||
# If GOPATH not specified, use one in the local directory
|
# If GOPATH not specified, use one in the local directory
|
||||||
ifeq ($(GOPATH),)
|
ifeq ($(GOPATH),)
|
||||||
export GOPATH := $(CURDIR)/_output
|
export GOPATH := $(HOME)/go
|
||||||
unexport GOBIN
|
unexport GOBIN
|
||||||
endif
|
endif
|
||||||
FIRST_GOPATH := $(firstword $(subst :, ,$(GOPATH)))
|
FIRST_GOPATH := $(firstword $(subst :, ,$(GOPATH)))
|
||||||
@ -98,6 +98,8 @@ ifeq ($(GOBIN),)
|
|||||||
GOBIN := $(FIRST_GOPATH)/bin
|
GOBIN := $(FIRST_GOPATH)/bin
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
export PATH := $(PATH):$(GOBIN)
|
||||||
|
|
||||||
GOMD2MAN ?= $(shell command -v go-md2man || echo '$(GOBIN)/go-md2man')
|
GOMD2MAN ?= $(shell command -v go-md2man || echo '$(GOBIN)/go-md2man')
|
||||||
|
|
||||||
CROSS_BUILD_TARGETS := \
|
CROSS_BUILD_TARGETS := \
|
||||||
@ -206,7 +208,7 @@ endif
|
|||||||
podman: bin/podman
|
podman: bin/podman
|
||||||
|
|
||||||
.PHONY: bin/podman-remote
|
.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
|
$(GO) build $(BUILDFLAGS) -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "${REMOTETAGS}" -o $@ ./cmd/podman
|
||||||
|
|
||||||
.PHONY: bin/podman-remote-static
|
.PHONY: bin/podman-remote-static
|
||||||
@ -277,7 +279,6 @@ clean: ## Clean artifacts
|
|||||||
libpod/container_easyjson.go \
|
libpod/container_easyjson.go \
|
||||||
libpod/pod_easyjson.go \
|
libpod/pod_easyjson.go \
|
||||||
.install.goimports \
|
.install.goimports \
|
||||||
.generate-bindings \
|
|
||||||
docs/build
|
docs/build
|
||||||
make -C docs clean
|
make -C docs clean
|
||||||
|
|
||||||
@ -463,12 +464,11 @@ podman-remote-%-release:
|
|||||||
rm -f release.txt
|
rm -f release.txt
|
||||||
$(MAKE) podman-remote-release-$*.zip
|
$(MAKE) podman-remote-release-$*.zip
|
||||||
|
|
||||||
BINDINGS_SOURCE = $(wildcard pkg/bindings/**/types.go)
|
.PHONY: generate-bindings
|
||||||
.generate-bindings: $(BINDINGS_SOURCE)
|
generate-bindings:
|
||||||
ifneq ($(shell uname -s), Darwin)
|
ifneq ($(shell uname -s), Darwin)
|
||||||
$(GO) generate -mod=vendor ./pkg/bindings/... ;
|
GO111MODULE=off $(GO) generate ./pkg/bindings/... ;
|
||||||
endif
|
endif
|
||||||
touch .generate-bindings
|
|
||||||
|
|
||||||
.PHONY: docker-docs
|
.PHONY: docker-docs
|
||||||
docker-docs: docs
|
docker-docs: docs
|
||||||
|
@ -146,9 +146,11 @@ function _run_swagger() {
|
|||||||
cp -v $GOSRC/pkg/api/swagger.yaml $GOSRC/
|
cp -v $GOSRC/pkg/api/swagger.yaml $GOSRC/
|
||||||
}
|
}
|
||||||
|
|
||||||
function _run_vendor() {
|
function _run_consistency() {
|
||||||
make vendor
|
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() {
|
function _run_build() {
|
||||||
|
@ -214,7 +214,7 @@ case "$TEST_FLAVOR" in
|
|||||||
|
|
||||||
install_test_configs
|
install_test_configs
|
||||||
;;
|
;;
|
||||||
vendor) make clean ;;
|
consistency) make clean ;;
|
||||||
release) ;;
|
release) ;;
|
||||||
*) die_unknown TEST_FLAVOR
|
*) die_unknown TEST_FLAVOR
|
||||||
esac
|
esac
|
||||||
|
Reference in New Issue
Block a user