-
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
be73f7e
Add bazel targets for standalone plugin binaries
bufdev 5209c52
Make the targets public
srikrsna-buf d3ee677
Merge pull request #1 from srikrsna-buf/standalone-plugins
bufdev 57d62a3
Rename to `plugin_main.cc`
srikrsna-buf f1c3629
Merge pull request #2 from srikrsna-buf/standalone-plugins
bufdev c446374
Merge branch 'main' into standalone-plugins
bufdev 306e1d5
Merge branch 'standalone-plugins' of https://github.com/bufdev/protob…
bufdev 735e3fd
Merge branch 'main' into standalone-plugins
bufdev b3a5952
Fix
bufdev 45d44f6
Hopefully fix
bufdev 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -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/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); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -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); | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -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); | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -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); | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -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); | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -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); | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
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.
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?