Skip to content

Reproducable httpgrpc.pb.go build#264

Merged
bboreham merged 3 commits intoweaveworks:masterfrom
krajorama:reproducable-proto-build
Nov 24, 2022
Merged

Reproducable httpgrpc.pb.go build#264
bboreham merged 3 commits intoweaveworks:masterfrom
krajorama:reproducable-proto-build

Conversation

@krajorama
Copy link
Copy Markdown
Contributor

@krajorama krajorama commented Nov 24, 2022

Reproducable httpgrpc.pb.go build

Use gogo protobuf options explicitly to generate the same Equal, String,
GoString etc functions in the protobuf implementation.

Add tools.go to download the gogo.proto dependency.
Add vendor directory as include for protoc to load the dependency.
Update protoc version otherwise there is a diff in the generated files,
most notably
const _ = proto.GoGoProtoPackageIsVersion3
is replaced with
const _ = proto.GoGoProtoPackageIsVersion2

Add check-protos target

This is a simple check to catch if proto generation changes files.

Check generated protobuf files in CI

Signed-off-by: György Krajcsovits gyorgy.krajcsovits@grafana.com

@krajorama krajorama force-pushed the reproducable-proto-build branch 4 times, most recently from 01dad76 to 8993d8f Compare November 24, 2022 12:29
Copy link
Copy Markdown
Collaborator

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! One small request, maybe it can go in a commit message.


# A 3-year-old image which is a reasonable match for the last time the files were generated.
PROTOC_IMAGE=namely/protoc:1.22_1
PROTOC_IMAGE=namely/protoc:1.23_0
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you mention somewhere why this changed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's 3 small(?) changes in the generated files otherwise, I've noted the most interesting one in the commit message and above in the PR description

Use gogo protobuf options explicitly to generate the same Equal, String,
GoString etc functions in the protobug implementation.

Add tools.go to download the gogo.proto dependency.
Add vendor directory as include for protoc to load the dependency.
Update protoc version otherwise there is a diff in the generated files,
most notably
const _ = proto.GoGoProtoPackageIsVersion3
is replaced with
const _ = proto.GoGoProtoPackageIsVersion2

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This is a simple check to catch if proto generation changes files.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Copy link
Copy Markdown
Collaborator

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

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