-
Notifications
You must be signed in to change notification settings - Fork 146
Description
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 on make the protobuf code still has a dependency on protoc for go 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 using go generate ./... at the root of the repo could have unintended side effects, such as changing the protoc version with which the code was generated, depending on the version that is installed on the machine running go 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 the pb directory should be simple and convenient enough.
cc: @gammazero