-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add features files to the set of standard imports #295
Conversation
… protocompile.WithStandardImports
5a18cfd
to
4014fb1
Compare
How would we go about updating the protoset files and would other languages be included as they are added? |
To the first part: that's part of the To the second: if they add new files to the core Protobuf SDK (that now includes |
Co-authored-by: Edward McFarlane <3036610+emcfarlane@users.noreply.github.com>
The "standard imports" (made available to compile operations using `protocompile.WithStandardImports`) are files that would be included with `protoc`, if a user were instead compiling with `protoc`. As of v26.1, `protoc` now includes two new files: "goole/protobuf/cpp_features.proto" and "google/protobuf/java_features.proto". But these are _not_ generated to Go code into packages in the Protobuf runtime, unlike all of the other well-known imports. So, for these, we embed binary-encoded file descriptors. Notably `protoc` does **not** include "google/protobuf/go_features.proto". However, that file _is_ part of the Go Protobuf runtime, with its generated code being available via the `google.golang.org/protobuf/types/gofeaturespb` package. So we also make that file available via `protocompile.WithStandardImports` (even though `protoc` doesn't include it). (cherry picked from commit 83dc971)
The "standard imports" (made available to compile operations using `protocompile.WithStandardImports`) are files that would be included with `protoc`, if a user were instead compiling with `protoc`. As of v26.1, `protoc` now includes two new files: "goole/protobuf/cpp_features.proto" and "google/protobuf/java_features.proto". But these are _not_ generated to Go code into packages in the Protobuf runtime, unlike all of the other well-known imports. So, for these, we embed binary-encoded file descriptors. Notably `protoc` does **not** include "google/protobuf/go_features.proto". However, that file _is_ part of the Go Protobuf runtime, with its generated code being available via the `google.golang.org/protobuf/types/gofeaturespb` package. So we also make that file available via `protocompile.WithStandardImports` (even though `protoc` doesn't include it). (cherry picked from commit 83dc971)
The "standard imports" (made available to compile operations using
protocompile.WithStandardImports
) are files that would be included withprotoc
, if a user were instead compiling withprotoc
.As of v26.1,
protoc
now includes two new files: "goole/protobuf/cpp_features.proto" and "google/protobuf/java_features.proto". But these are not generated to Go code into packages in the Protobuf runtime, unlike all of the other well-known types. So, for these, we embed binary-encoded file descriptors.Notably
protoc
does not include "google/protobuf/go_features.proto". However, that file is part of the Go Protobuf runtime, with its generated code being available via thegoogle.golang.org/protobuf/types/gofeaturespb
package. So we also make that file available viaprotocompile.WithStandardImports
(even thoughprotoc
doesn't include it).