diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-05-02 10:28:41 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-05-06 11:44:31 +0300 |
commit | 1e9c88548cd9821353fad98fca37f1cbc8b73ba0 (patch) | |
tree | 42f86f8856ac802f129774cade261f187e8fff0b | |
parent | 3f30f8999301a6e60b1c39f6bea739b943a5402f (diff) |
Makefile: Fix cyclic dependencies when generating Protobuf definitions
The `protoc-gen-gitaly-lint` plugin requires the Protobuf definitions in
order to work correctly, but it itself is added already when generating
these definitions in the first place. This is a cyclic dependency which
breaks generation of Protobufs when starting from scratch.
Now that functionality of `protoc-gen-gitaly` has been split up into two
different plugins we can easily fix this cyclic dependency by moving use
of the linting part into `lint-proto`. This refactoring also makes sense
on its own.
-rw-r--r-- | Makefile | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -440,11 +440,11 @@ cover: prepare-tests libgit2 ${GOCOVER_COBERTURA} .PHONY: proto ## Regenerate protobuf definitions. -proto: SHARED_PROTOC_OPTS = --plugin=${PROTOC_GEN_GO} --plugin=${PROTOC_GEN_GO_GRPC} --plugin=${PROTOC_GEN_GITALY_LINT} --plugin=${PROTOC_GEN_GITALY_PROTOLIST} --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative -proto: ${PROTOC} ${PROTOC_GEN_GO} ${PROTOC_GEN_GO_GRPC} ${PROTOC_GEN_GITALY_LINT} ${PROTOC_GEN_GITALY_PROTOLIST} ${SOURCE_DIR}/.ruby-bundle +proto: SHARED_PROTOC_OPTS = --plugin=${PROTOC_GEN_GO} --plugin=${PROTOC_GEN_GO_GRPC} --plugin=${PROTOC_GEN_GITALY_PROTOLIST} --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative +proto: ${PROTOC} ${PROTOC_GEN_GO} ${PROTOC_GEN_GO_GRPC} ${PROTOC_GEN_GITALY_PROTOLIST} ${SOURCE_DIR}/.ruby-bundle ${Q}mkdir -p ${SOURCE_DIR}/proto/go/gitalypb ${Q}rm -f ${SOURCE_DIR}/proto/go/gitalypb/*.pb.go - ${PROTOC} ${SHARED_PROTOC_OPTS} -I ${SOURCE_DIR}/proto -I ${PROTOC_INSTALL_DIR}/include --go_out=${SOURCE_DIR}/proto/go/gitalypb --gitaly-protolist_out=proto_dir=${SOURCE_DIR}/proto,gitalypb_dir=${SOURCE_DIR}/proto/go/gitalypb:${SOURCE_DIR} --gitaly-lint_out=${SOURCE_DIR} --go-grpc_out=${SOURCE_DIR}/proto/go/gitalypb ${SOURCE_DIR}/proto/*.proto + ${PROTOC} ${SHARED_PROTOC_OPTS} -I ${SOURCE_DIR}/proto -I ${PROTOC_INSTALL_DIR}/include --go_out=${SOURCE_DIR}/proto/go/gitalypb --gitaly-protolist_out=proto_dir=${SOURCE_DIR}/proto,gitalypb_dir=${SOURCE_DIR}/proto/go/gitalypb:${SOURCE_DIR} --go-grpc_out=${SOURCE_DIR}/proto/go/gitalypb ${SOURCE_DIR}/proto/*.proto ${SOURCE_DIR}/_support/generate-proto-ruby @ # this part is related to the generation of sources from testing proto files ${PROTOC} ${SHARED_PROTOC_OPTS} -I ${SOURCE_DIR}/internal --go_out=${SOURCE_DIR}/internal --go-grpc_out=${SOURCE_DIR}/internal ${SOURCE_DIR}/internal/praefect/grpc-proxy/testdata/test.proto @@ -459,7 +459,8 @@ proto: ${PROTOC} ${PROTOC_GEN_GO} ${PROTOC_GEN_GO_GRPC} ${PROTOC_GEN_GITALY_LINT check-proto: proto no-proto-changes lint-proto .PHONY: lint-proto -lint-proto: ${PROTOLINT} +lint-proto: ${PROTOC} ${PROTOLINT} ${PROTOC_GEN_GITALY_LINT} + ${Q}${PROTOC} -I ${SOURCE_DIR}/proto -I ${PROTOC_INSTALL_DIR}/include --plugin=${PROTOC_GEN_GITALY_LINT} --gitaly-lint_out=${SOURCE_DIR} ${SOURCE_DIR}/proto/*.proto ${Q}${PROTOLINT} lint -config_dir_path=${SOURCE_DIR}/proto ${SOURCE_DIR}/proto .PHONY: no-changes |