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

hack: use tools build constraint for generated-files deps #3236

Merged
merged 2 commits into from
Nov 25, 2022

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Oct 29, 2022

fixes #3187
follow-up docker/buildx#1296 (comment)

Inferred go install from go.mod using tools build constraint so proto generation is aligned.

github.com/golang/protobuf/protoc-gen-go switches from 1.3.5 to 1.5.2.

Looking at the release notes and since 1.4.0:

This release of the github.com/golang/protobuf module introduces a number of significant changes relative to the previous minor release. In particular, this module is now implemented in terms of the new google.golang.org/protobuf module, which is the next major revision of Go bindings for protocol buffers. From this point onwards, most of the development effort for Go protobufs will be dedicated to the new module, with minimal changes being made to this module.

The API of this new module is not drop-in compatible with the earlier github.com/golang/protobuf module. See https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.20.0 for backward compat.

@crazy-max crazy-max marked this pull request as ready for review October 29, 2022 08:33
@crazy-max crazy-max force-pushed the generated-infer-gomod branch 2 times, most recently from f2c9958 to 47bd4b3 Compare October 29, 2022 08:47
Copy link
Member

@jedevc jedevc left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me - I have some confusion around pb_tools.go, but otherwise looks good to me.

Nice to see the collection of shell scripts shrinking and moving into Dockerfiles.

hack/dockerfiles/generated-files.Dockerfile Outdated Show resolved Hide resolved
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Copy link
Member

@jedevc jedevc left a comment

Choose a reason for hiding this comment

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

The need for tools.go is still kind of frustrating, but it feels a bit like a necessary evil - it's still an improvement on what we have today, so seems fine to me 🤷

PTAL @tonistiigi

@crazy-max
Copy link
Member Author

As discussed with tonis, I have updated the comment in the package to warn users if they want to add other tools.

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.

github.com/golang/protobuf version for generated files
3 participants