api, linux/runcopts: ensure output is current

Ensure that the descriptors are re-generated on the CI and block merges
that don't include updates. We also enable the `check-protos` check as
part of this process. The installation process for protobufs has been
fixed to support protobuild.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day
2017-09-06 13:46:29 -07:00
parent 843b35c9f2
commit 157cfb1ad2
4 changed files with 40 additions and 7 deletions

View File

@@ -83,12 +83,18 @@ protos: bin/protoc-gen-gogoctrd ## generate protobuf
@echo "$(WHALE) $@"
@PATH=${ROOTDIR}/bin:${PATH} protobuild ${PACKAGES}
checkprotos: protos ## check if protobufs needs to be generated again
check-protos: protos ## check if protobufs needs to be generated again
@echo "$(WHALE) $@"
@test -z "$$(git status --short | grep ".pb.go" | tee /dev/stderr)" || \
((git diff | cat) && \
(echo "$(ONI) please run 'make generate' when making changes to proto files" && false))
check-api-descriptors: protos ## check that protobuf changes aren't present.
@echo "$(WHALE) $@"
@test -z "$$(git status --short | grep ".pb.txt" | tee /dev/stderr)" || \
((git diff $$(find . -name '*.pb.txt') | cat) && \
(echo "$(ONI) please run 'make protos' when making changes to proto files and check-in the generated descriptor file changes" && false))
# Depends on binaries because vet will silently fail if it can't load compiled
# imports
vet: ## run go vet