-
Notifications
You must be signed in to change notification settings - Fork 18
Only build common protos with --grpc option for LRO. #109
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,9 @@ var DEFAULT_PROTO_COMPILER = 'protoc'; | |
// Python builds using grpcio-tools. | ||
var NO_PROTOC_PLUGIN = ['nodejs', 'java', 'python']; | ||
|
||
// common protos for which we build gRPC service methods | ||
var COMMON_GRPC_PROTOS = ['operations.proto']; | ||
|
||
// the default include path, where install the protobuf runtime installs its | ||
// protos. | ||
var DEFAULT_INCLUDE_PATH = Object.freeze(['/usr/local/include']); | ||
|
@@ -1018,11 +1021,14 @@ ApiRepo.prototype._makeProtocFunc = function _makeProtocFunc(opts, language) { | |
pluginOption = '--plugin='; | ||
} else { | ||
args.push('--' + language + '_out=' + outDir); | ||
if (language === 'python') { | ||
// required per https://github.com/grpc/grpc/issues/7857 | ||
args.push('--grpc_python_out=' + outDir); | ||
} else { | ||
args.push('--grpc_out=' + outDir); | ||
if (!opts.buildCommonProtos || | ||
_.includes(COMMON_GRPC_PROTOS, protoPath)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this the path from the proto's rootdir (i.e. 'google/longrunning/operations.proto')? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's just the last element. |
||
if (language === 'python') { | ||
// required per https://github.com/grpc/grpc/issues/7857 | ||
args.push('--grpc_python_out=' + outDir); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought we decided not to do this in order to support GAE? My understanding was that this required a more complex change to generate both gRPC and gRPC-less modules. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After offline discussion, I understand that this is actually an improvement over the current state of master, where every common proto is being built with the gRPC plugin (and hence is potentially GAE-incompatible). |
||
} else { | ||
args.push('--grpc_out=' + outDir); | ||
} | ||
} | ||
} | ||
if (!_.includes(NO_PROTOC_PLUGIN, language)) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding bytestream.proto as well? It's not in the common protos right now, but might be worth adding here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I don't have the context on that, but I don't object.