fix: protobuf generation process #800
Labels
dif/easy
Someone with a little familiarity can pick up
effort/hours
Estimated to take one or several hours
kind/maintenance
Work required to avoid breaking changes or harm to project's status quo
P2
Medium: Good to have, but can wait until someone steps up
Follow up to #794
The protobuf code (
.pb.go
) has to be generated only once after a change in the.proto
file, then the.pb.go
file is pushed to the repo and nodes never need to generate. Even when not depending onmake
the protobuf code still has a dependency onprotoc
forgo generate ./...
to work.IMO it is better that the protobuf code gets updated only after a conscious decision from the person modifying the
.proto
file. Being able to overwrite all.pb.go
files usinggo generate ./...
at the root of the repo could have unintended side effects, such as changing theprotoc
version with which the code was generated, depending on the version that is installed on the machine runninggo generate ./...
.It may possible to avoid non-go dependencies (
make
,protoc
) by depending directly on protobuf-go, but then we would need a dedicated package for the protobuf code generation.Since protobuf code is very rarely generated, IMO it is fine to use either
go generate
, a Makefile, or even a dedicated go code, but we should prevent accidental generation. Generating the protobuf code only from thepb
directory should be simple and convenient enough.cc: @gammazero
The text was updated successfully, but these errors were encountered: