This repository has been archived by the owner on Jan 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Only build common protos with --grpc option for LRO. #109
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', 'bytestream.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)) { | ||
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)) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's just the last element.
pkg
has the path.