Skip to content

updated, now generated code won't compile and fields marked with xxx_ ? #615

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
ashtonian opened this issue May 22, 2018 · 6 comments
Closed

Comments

@ashtonian
Copy link

Not sure what happened, went to add a field to our messages (IsFanout), ran go get -u github.com/golang/protobuf/protoc-gen-g ran protoc -I=. --go_out=. ./messages.proto and the resulting file won't compile and also has a lot of fields marked xxx_. I've attached a zip with the old files and the new ones for comparison. Should I be using a different version?

protobuff.zip

@dsnet
Copy link
Member

dsnet commented May 22, 2018

What is the compilation error? The newly generated .pb.go file looks fine and directly compiling it works too: go build messages.new.pb.go.

@ashtonian
Copy link
Author

ashtonian commented May 22, 2018

Thanks for the fast response!

Build errors:

# github.com/meshifyiot/carbon/common/messages
./messages.pb.go:74:30: undefined: proto.InternalMessageInfo
./messages.pb.go:131:32: undefined: proto.InternalMessageInfo
./messages.pb.go:261:32: undefined: proto.InternalMessageInfo
./messages.pb.go:365:32: undefined: proto.InternalMessageInfo
./messages.pb.go:482:36: undefined: proto.InternalMessageInfo
./messages.pb.go:591:31: undefined: proto.InternalMessageInfo
./messages.pb.go:697:33: undefined: proto.InternalMessageInfo 

Did some further investigation and it was caused by vendored old version not matching the new version. So no issue anymore, can close, thanks.

So what are the XXX_ fields and what if I don't want them?

@dsnet
Copy link
Member

dsnet commented May 22, 2018

Ah, I think this can be fixed with simply doing go get -u github.com/golang/protobuf/proto.

It seems that you're running a newer version of protoc-gen-go, but not a new enough version of the proto package.

@dsnet
Copy link
Member

dsnet commented May 22, 2018

So what are the XXX_ fields and what if I don't want them?

They are for the internal implementation of proto and will eventually go away. See #276

@ashtonian
Copy link
Author

awesome, thanks!

@firstthumb
Copy link

Thanks @dsnet It solved the problem

@golang golang locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants