-
Notifications
You must be signed in to change notification settings - Fork 16.2k
Add bazel targets for standalone plugin binaries #23919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
be73f7e
5209c52
d3ee677
57d62a3
f1c3629
c446374
306e1d5
735e3fd
b3a5952
45d44f6
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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Protocol Buffers - Google's data interchange format | ||
|
Member
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. Can you rename these to Looks like we use
Contributor
Author
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. Done. |
||
| // Copyright 2008 Google Inc. All rights reserved. | ||
| // | ||
| // Use of this source code is governed by a BSD-style | ||
| // license that can be found in the LICENSE file or at | ||
| // https://developers.google.com/open-source/licenses/bsd | ||
|
|
||
| #include "google/protobuf/compiler/csharp/csharp_generator.h" | ||
| #include "google/protobuf/compiler/plugin.h" | ||
|
|
||
| int main(int argc, char *argv[]) { | ||
| google::protobuf::compiler::csharp::Generator generator; | ||
| return google::protobuf::compiler::PluginMain(argc, argv, &generator); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Protocol Buffers - Google's data interchange format | ||
| // Copyright 2008 Google Inc. All rights reserved. | ||
| // | ||
| // Use of this source code is governed by a BSD-style | ||
| // license that can be found in the LICENSE file or at | ||
| // https://developers.google.com/open-source/licenses/bsd | ||
|
|
||
| #include "google/protobuf/compiler/kotlin/generator.h" | ||
| #include "google/protobuf/compiler/plugin.h" | ||
|
|
||
| int main(int argc, char *argv[]) { | ||
| google::protobuf::compiler::kotlin::KotlinGenerator generator; | ||
| return google::protobuf::compiler::PluginMain(argc, argv, &generator); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Protocol Buffers - Google's data interchange format | ||
| // Copyright 2008 Google Inc. All rights reserved. | ||
| // | ||
| // Use of this source code is governed by a BSD-style | ||
| // license that can be found in the LICENSE file or at | ||
| // https://developers.google.com/open-source/licenses/bsd | ||
|
|
||
| #include "google/protobuf/compiler/objectivec/generator.h" | ||
| #include "google/protobuf/compiler/plugin.h" | ||
|
|
||
| int main(int argc, char *argv[]) { | ||
| google::protobuf::compiler::objectivec::ObjectiveCGenerator generator; | ||
| return google::protobuf::compiler::PluginMain(argc, argv, &generator); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Protocol Buffers - Google's data interchange format | ||
| // Copyright 2008 Google Inc. All rights reserved. | ||
| // | ||
| // Use of this source code is governed by a BSD-style | ||
| // license that can be found in the LICENSE file or at | ||
| // https://developers.google.com/open-source/licenses/bsd | ||
|
|
||
| #include "google/protobuf/compiler/php/php_generator.h" | ||
| #include "google/protobuf/compiler/plugin.h" | ||
|
|
||
| int main(int argc, char *argv[]) { | ||
| google::protobuf::compiler::php::Generator generator; | ||
| return google::protobuf::compiler::PluginMain(argc, argv, &generator); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Protocol Buffers - Google's data interchange format | ||
| // Copyright 2008 Google Inc. All rights reserved. | ||
| // | ||
| // Use of this source code is governed by a BSD-style | ||
| // license that can be found in the LICENSE file or at | ||
| // https://developers.google.com/open-source/licenses/bsd | ||
|
|
||
| #include "google/protobuf/compiler/plugin.h" | ||
| #include "google/protobuf/compiler/python/pyi_generator.h" | ||
|
|
||
| int main(int argc, char *argv[]) { | ||
| google::protobuf::compiler::python::PyiGenerator generator; | ||
| return google::protobuf::compiler::PluginMain(argc, argv, &generator); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Protocol Buffers - Google's data interchange format | ||
| // Copyright 2008 Google Inc. All rights reserved. | ||
| // | ||
| // Use of this source code is governed by a BSD-style | ||
| // license that can be found in the LICENSE file or at | ||
| // https://developers.google.com/open-source/licenses/bsd | ||
|
|
||
| #include "google/protobuf/compiler/plugin.h" | ||
| #include "google/protobuf/compiler/ruby/ruby_generator.h" | ||
|
|
||
| int main(int argc, char *argv[]) { | ||
| google::protobuf::compiler::ruby::Generator generator; | ||
| return google::protobuf::compiler::PluginMain(argc, argv, &generator); | ||
| } |
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.
Can you mark these all as //visibility:private for now? While we may want to officially support and release standalone binaries for these plugins at some point in the future, we would likely need to add corresponding supporte policies and / or poison pills to ensure protoc and plugin are used with supported version combinations first. Currently defacto with the built-in generators is that protoc + plugins are necessarily at the same version by default.
Keeping these private for now may help a bit with accidental mis-use in the interim, until we can get guardrails in place.
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.
Unfortunately, making these private would pretty much defeat the goal of this PR - making these usable by others is the whole point :-)
Re: poison pills, do you just mean something like https://github.com/bufbuild/buf/blob/d500877026294fa52819fb20b98101d2c2c70fe3/private/gen/proto/go/buf/alpha/image/v1/image.pb.go#L33 or do you mean something more extensive? If this, we're happy to do this in this PR. If something more extensive, I'd question the need or desire - the rest of the Protobuf plugin ecosystem functions just fine without these type of block FWIW, and I think that's appropriate.
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.
Yep, I was referring to some sort of version check enforcing only compatible versions are used!
Discussed with the team and it should be ok to accept these as public targets. Note though that we don't have guarantees for these in our support matrix yet for how these targets would be expected to behave yet esp when versions are mixed, so I do err on preffering some guardrails here (but followup should be fine for that).
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 great to hear. Other than the failing tests below (which I think are unrelated, I'll merge the latest from main) is there anything else you'd like us to do in this PR?