diff --git a/.gitignore b/.gitignore index a66dcb760cd..0914ea8b2f2 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ cmd/tracegen/tracegen-* crossdock/crossdock-* run-crossdock.log proto-gen/.patched-otel-proto/ +proto-gen/.includes/ __pycache__ .asset-manifest.json deploy/ diff --git a/Makefile.Protobuf.mk b/Makefile.Protobuf.mk index 447c830e41f..a6117791ae7 100644 --- a/Makefile.Protobuf.mk +++ b/Makefile.Protobuf.mk @@ -14,7 +14,7 @@ # instead of the go_package's declared by the imported protof files. # -DOCKER_PROTOBUF_VERSION=0.5.0 +DOCKER_PROTOBUF_VERSION=v0.5.1rc DOCKER_PROTOBUF=jaegertracing/protobuf:$(DOCKER_PROTOBUF_VERSION) PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${DOCKER_PROTOBUF} --proto_path=${PWD} @@ -24,6 +24,7 @@ PROTO_INCLUDES := \ -Iidl/proto/api_v2 \ -Iidl/proto/api_v3 \ -Imodel/proto/metrics \ + -Iproto-gen/.includes \ -I/usr/include/github.com/gogo/protobuf # Remapping of std types to gogo types (must not contain spaces) @@ -77,9 +78,9 @@ define proto_compile endef -# TODO add proto-hotrod to the list after regenerating its file (may need linter tweaking) .PHONY: proto -proto: proto-model \ +proto: proto-download-google-apis \ + proto-model \ proto-api-v2 \ proto-storage-v1 \ proto-hotrod \ @@ -88,6 +89,14 @@ proto: proto-model \ proto-otel \ proto-api-v3 +.PHONY: proto-download-google-apis +proto-download-google-apis: + mkdir -p ./proto-gen/.includes/google/api/ + curl -sSL -o ./proto-gen/.includes/google/api/annotations.proto \ + https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/annotations.proto + curl -sSL -o ./proto-gen/.includes/google/api/http.proto \ + https://raw.githubusercontent.com/googleapis/googleapis/master/google/api/http.proto + .PHONY: proto-model proto-model: $(call proto_compile, model, idl/proto/api_v2/model.proto)