Skip to content
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

Non-Lite Protos #96

Open
dhulihan opened this issue Jul 12, 2021 · 2 comments · May be fixed by #97
Open

Non-Lite Protos #96

dhulihan opened this issue Jul 12, 2021 · 2 comments · May be fixed by #97

Comments

@dhulihan
Copy link

dhulihan commented Jul 12, 2021

Hi, I'm trying to include a phonenumbers.PhoneNumber proto in another proto file (a v3 file that is not using LITE_RUNTIME) like so:

// phone_number.proto
syntax = "proto3";

package phoneproto;

option go_package="github.com/foo/bar/phoneproto";

import "github.com/nyaruka/phonenumbers/phonenumber.proto";

message PhoneNumberRequest {
    phonenumbers.PhoneNumber phone_number = 1;
}

but i'm getting an error when compiling to go:

phone_number.proto: Files that do not use optimize_for = LITE_RUNTIME cannot import files which do use this option.  This file is not lite, but it imports "github.com/nyaruka/phonenumbers/phonenumber.proto" which is.

I really like that protos are available, but it would be nice to be able to reuse your proto files that don't use LITE_RUNTIME.

@dhulihan
Copy link
Author

Ideas for addressing this:

  • provide a non-lite file in a different protobuf package, eg: in protobuf/heavy/phonenumber.proto.
  • Figure out some way to ignore option optimize_for = LITE_RUNTIME;. I haven't found a way to do this yet.

@dhulihan
Copy link
Author

dhulihan commented Jul 19, 2021

It looks like this directive is no longer supported.

In Proto3 syntax files, "optimized_for=LITE_RUNTIME" is no longer supported.

https://github.com/protocolbuffers/protobuf/blob/master/CHANGES.txt#L1826
https://github.com/protocolbuffers/protobuf/blob/v3.0.0-beta-3/CHANGES.txt#L130

@dhulihan dhulihan linked a pull request Jul 19, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant