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

chore: introduce buf for code generation #2515

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

imcom
Copy link
Contributor

@imcom imcom commented Dec 28, 2021

I would like to introduce the usage of buf with gobgp project. The tool can help to maintain and generate code from .proto files

@fujita
Copy link
Member

fujita commented Dec 28, 2021

Can force the specific version of protoc?

@imcom
Copy link
Contributor Author

imcom commented Dec 28, 2021

Can force the specific version of protoc?

I believe the unknown version comes from this replacement

It has its own complier, the only difference I see now is the unknown tag in generated code. Anything else should I pay attention to ?

@imcom
Copy link
Contributor Author

imcom commented Dec 28, 2021

more information as follows:
https://docs.buf.build/build/internal-compiler

@fujita
Copy link
Member

fujita commented Jan 1, 2022

Do you propose replacing protoc with this tool?

@imcom
Copy link
Contributor Author

imcom commented Jan 4, 2022

Do you propose replacing protoc with this tool?

The buf project is getting more and more attention from the community and does provide more tooling stuff than protoc, not quite a replacement for the use of protoc in gobgp project but at least it is an option when people try to build and develop gobgp.

I do see the tool's lint reports many concerns we do not want/have to adopt at the moment. protoc and buf can coexist with no harm.

@fujita
Copy link
Member

fujita commented Jan 5, 2022

buf might generate code slightly different from protoc, right? Then if someone submit a pull request including the code generated by buf, it's supposed to be rejected. We don't need pointless changes of *.pb.go, right?

@imcom
Copy link
Contributor Author

imcom commented Jan 6, 2022

buf might generate code slightly different from protoc, right? Then if someone submit a pull request including the code generated by buf, it's supposed to be rejected. We don't need pointless changes of *.pb.go, right?

I got your point, although buf claims to be just as same as protoc. The additional risk is true, as you said. I believe we can keep this pull request open for a prolonged evaluation/observation of buf project and continue our discussion from there. Sounds good?

@fujita
Copy link
Member

fujita commented Jan 6, 2022

sure, let this pr open.

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 this pull request may close these issues.

2 participants