-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
make Protobuf generation deterministic #2429
Comments
Looking at the protobuf version doc
It looks like your machine's protoc version changed between the runs. The latest protc version is v23.3(on homebrew) which generates files with v4.23.3. Should we mention the protobuf compiler version to be used somewhere in the repo? I don't see it mentioned anywhere currently. |
I was hoping we could do something like this: By using It seems like this would be more difficult to accomplish with the protobuf compiler, since protoc has to be installed separately. |
Maybe the IPDX team has some ideas here. @galargh and @laurentsenta, have you encountered this before? Is there a good solution for this problem? |
Some assume the risk and remove the version information from the generated files - golang/protobuf#1185 Off the top of my head, one could also do go generate in docker with pinned deps - e.g https://github.com/moby/moby/blob/master/hack/dockerfiles/generate-files.Dockerfile |
I'd like to avoid using Docker for code generation. It would be nice if
This sounds reasonable. I assume we'd still commit the files with the version information, but remove it in CI before comparing? |
That's an interesting idea! From what I've seen people generally strip the versions before commit but I think doing it for compare only is more clever. We could even do one check with stripped version and if it fails do another one without stripping so that the version diff shows up in the output. I'm going to track the implementation here: ipdxco/unified-github-workflows#26 |
Closing since @galargh fixed this issue by adjusting the GHA workflows. |
go generate ./...
run locally should produce the same Protobuf output as when run on CI.The text was updated successfully, but these errors were encountered: