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

Struggling to generate PHP code with gogoproto.proto being proto2 #324

Open
yaronsumel opened this Issue Aug 16, 2017 · 16 comments

Comments

Projects
None yet
2 participants
@yaronsumel
Contributor

yaronsumel commented Aug 16, 2017

While compiling my .proto that making use of protobuf/gogoproto/gogo.proto
im getting --php_out: gogoproto/gogo.proto: Can only generate PHP code for proto3 .proto files.
I did changed the proto2 to proto3 and removed the old syntax in this file and its seems fine.. are we having tech debt with that file or is it possible to PR the change ?

@yaronsumel

This comment has been minimized.

Show comment
Hide comment
@yaronsumel

yaronsumel Aug 16, 2017

Contributor

also getting wrong paths with that php compiler :\

        \GPBMetadata\GithubCom\Gogo\Protobuf\Gogoproto\Gogo::initOnce();
        \GPBMetadata\GithubCom\Digota\Digota\Payment\Paymentpb\Payment::initOnce(); 
Contributor

yaronsumel commented Aug 16, 2017

also getting wrong paths with that php compiler :\

        \GPBMetadata\GithubCom\Gogo\Protobuf\Gogoproto\Gogo::initOnce();
        \GPBMetadata\GithubCom\Digota\Digota\Payment\Paymentpb\Payment::initOnce(); 
@awalterschulze

This comment has been minimized.

Show comment
Hide comment
@awalterschulze

awalterschulze Aug 16, 2017

Member

gogo.proto uses extensions, which is a proto2 feature and which will not be supported by proto3.

I didn't realize php was not going to support proto2 at all. Thats very interesting.

Member

awalterschulze commented Aug 16, 2017

gogo.proto uses extensions, which is a proto2 feature and which will not be supported by proto3.

I didn't realize php was not going to support proto2 at all. Thats very interesting.

@awalterschulze

This comment has been minimized.

Show comment
Hide comment
@awalterschulze

awalterschulze Aug 16, 2017

Member

I actually don't know what to do in this case, but I'll think about it.

Member

awalterschulze commented Aug 16, 2017

I actually don't know what to do in this case, but I'll think about it.

@yaronsumel

This comment has been minimized.

Show comment
Hide comment
@yaronsumel

yaronsumel Aug 16, 2017

Contributor

is it passing build for any other lang ?

Contributor

yaronsumel commented Aug 16, 2017

is it passing build for any other lang ?

@awalterschulze

This comment has been minimized.

Show comment
Hide comment
@awalterschulze

awalterschulze Aug 16, 2017

Member

This is the first language that I have heard of that has a problem.
I know C++, since I helped fixed it, and Java, since I helped others integrate it, are working.
But I don't personally have experience with other languages.
protoc needs the gogo.proto import to make it do the parsing properly, but after that the languages should be able to completely ignore the import.

Member

awalterschulze commented Aug 16, 2017

This is the first language that I have heard of that has a problem.
I know C++, since I helped fixed it, and Java, since I helped others integrate it, are working.
But I don't personally have experience with other languages.
protoc needs the gogo.proto import to make it do the parsing properly, but after that the languages should be able to completely ignore the import.

@awalterschulze

This comment has been minimized.

Show comment
Hide comment
@awalterschulze

awalterschulze Aug 17, 2017

Member
Member

awalterschulze commented Aug 17, 2017

@yaronsumel

This comment has been minimized.

Show comment
Hide comment
@yaronsumel

yaronsumel Aug 17, 2017

Contributor

It actually does when the command is fine.. deleted my comment because the command will delete entire line and not just between the brackets

Contributor

yaronsumel commented Aug 17, 2017

It actually does when the command is fine.. deleted my comment because the command will delete entire line and not just between the brackets

@awalterschulze

This comment has been minimized.

Show comment
Hide comment
@awalterschulze

awalterschulze Aug 17, 2017

Member

Are you running your protoc --php_out command only on the files that are import gogo.proto and not on gogo.proto itself?

If so do you maybe want to bring up this issue with the protoc php project?
I think a proto3 file should still be able to import proto2 files, if the generator is not run on those specific files that are syntax=proto2.

Member

awalterschulze commented Aug 17, 2017

Are you running your protoc --php_out command only on the files that are import gogo.proto and not on gogo.proto itself?

If so do you maybe want to bring up this issue with the protoc php project?
I think a proto3 file should still be able to import proto2 files, if the generator is not run on those specific files that are syntax=proto2.

@yaronsumel

This comment has been minimized.

Show comment
Hide comment
@yaronsumel

yaronsumel Aug 17, 2017

Contributor

Yes I should open it !

Contributor

yaronsumel commented Aug 17, 2017

Yes I should open it !

@awalterschulze

This comment has been minimized.

Show comment
Hide comment
@awalterschulze

awalterschulze Aug 17, 2017

Member

Thanks. Please post the issue link so I can also follow it.

Member

awalterschulze commented Aug 17, 2017

Thanks. Please post the issue link so I can also follow it.

@yaronsumel

This comment has been minimized.

Show comment
Hide comment
@yaronsumel
Contributor

yaronsumel commented Aug 17, 2017

@yaronsumel

This comment has been minimized.

Show comment
Hide comment
@yaronsumel

yaronsumel Aug 17, 2017

Contributor

... and we are back to grep !! yay :(

Contributor

yaronsumel commented Aug 17, 2017

... and we are back to grep !! yay :(

@awalterschulze

This comment has been minimized.

Show comment
Hide comment
@awalterschulze

awalterschulze Aug 17, 2017

Member

Thank you. We'll see.

Member

awalterschulze commented Aug 17, 2017

Thank you. We'll see.

@yaronsumel

This comment has been minimized.

Show comment
Hide comment
@yaronsumel

yaronsumel Aug 17, 2017

Contributor

in Walter we trust

Contributor

yaronsumel commented Aug 17, 2017

in Walter we trust

@yaronsumel

This comment has been minimized.

Show comment
Hide comment
@yaronsumel

yaronsumel Aug 18, 2017

Contributor

grep -vw 'import "github.com/gogo/protobuf/gogoproto/gogo.proto";' payment/paymentpb/payment.proto | sed -e 's/\[[^][]*\]//g' > payment/paymentpb/paymentpb.proto

Contributor

yaronsumel commented Aug 18, 2017

grep -vw 'import "github.com/gogo/protobuf/gogoproto/gogo.proto";' payment/paymentpb/payment.proto | sed -e 's/\[[^][]*\]//g' > payment/paymentpb/paymentpb.proto

@awalterschulze

This comment has been minimized.

Show comment
Hide comment
@awalterschulze

awalterschulze Aug 18, 2017

Member
Member

awalterschulze commented Aug 18, 2017

@awalterschulze awalterschulze changed the title from Upgrade protobuf/gogoproto/gogo.proto to proto3 ? to Struggling to generate PHP code with gogoproto.proto being proto2 Sep 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment