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

go.mod: switch to gogoproto fork #134918

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

RaduBerinde
Copy link
Member

Use github.com/cockroachdb/gogoproto instead of
github.com/gogo/protobuf. The former already has a new omitempty
option that can clean up some existing hacks, and we want to make more
improvements to the generated code.

Fixes #134805
Release note: None

@RaduBerinde RaduBerinde requested a review from a team as a code owner November 12, 2024 02:27
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

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

Is there a world here in which we don't need a version in the replace directive? The moment you pin a version, you basically bypass version requirement resolution. I would love to get rid of the replace line for protobuf, which I seem to remember is causing us a lot of trouble and this is also somehow related to gogoproto (it isn't compatible with v2 protobuf?)
I know this isn't exactly in your critical path, but I think we have a little dependency hell here. Forking gogoproto can probably help here, but if we're pinning a version it could also go the other way. Could we get a sense of how deep the pit is? I'm happy to team up on that.

@tbg
Copy link
Member

tbg commented Nov 12, 2024

Nevermind, we have to provide a version on the right: https://go.dev/ref/mod#go-mod-file-replace
But it seems possible to specify a version on the left, which could let us opt out of letting dependencies that use gogoproto see the replacement. I don't know if that is helpful at all but it would reduce the amount of lying.

Re: protobuf, we have require github.com/gogo/protobuf v1.3.2 but then replace google.golang.org/protobuf => google.golang.org/protobuf v1.29.1, so we're straight-up lying about which version of googleproto we see. And I think we need that because (something something gogoproto not compatible with newer googleproto). That would be good to lift if we can.

I'm poking at it a bit in #134941.

@RaduBerinde
Copy link
Member Author

But it seems possible to specify a version on the left, which could let us opt out of letting dependencies that use gogoproto see the replacement. I don't know if that is helpful at all but it would reduce the amount of lying.

How would that work? Our binary must contain exactly one version of the library..

@RaduBerinde
Copy link
Member Author

TFTR!

bors r+

craig bot pushed a commit that referenced this pull request Nov 12, 2024
134525: kvserver: avoid key heap allocation in multiSSTWriter.rolloverSST r=tbg a=sumeerbhola

rolloverSST is called for every key-value pair in the incoming snapshot, and the key parameter was inadvertently escaping to the heap. This was 20% of the number of allocations on a node in the 150 node cluster test.

Epic: none

Release note: None

134918: go.mod: switch to gogoproto fork r=RaduBerinde a=RaduBerinde

Use `github.com/cockroachdb/gogoproto` instead of
`github.com/gogo/protobuf`. The former already has a new `omitempty`
option that can clean up some existing hacks, and we want to make more
improvements to the generated code.

Fixes #134805
Release note: None

Co-authored-by: sumeerbhola <sumeer@cockroachlabs.com>
Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Nov 12, 2024

Build failed (retrying...):

@RaduBerinde
Copy link
Member Author

bors r-

@craig
Copy link
Contributor

craig bot commented Nov 12, 2024

Canceled.

Use `github.com/cockroachdb/gogoproto` instead of
`github.com/gogo/protobuf`. The former already has a new `omitempty`
option that can clean up some existing hacks, and we want to make more
improvements to the generated code.

Fixes cockroachdb#134805
Release note: None
@RaduBerinde
Copy link
Member Author

bors r+

@craig craig bot merged commit 0954cde into cockroachdb:master Nov 12, 2024
22 of 23 checks passed
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.

deps: switch to using our gogoproto fork
4 participants