Skip to content

protobuf: remove gogoproto#2713

Merged
tonistiigi merged 1 commit into
docker:masterfrom
jsternberg:gogoproto-remove
Oct 2, 2024
Merged

protobuf: remove gogoproto#2713
tonistiigi merged 1 commit into
docker:masterfrom
jsternberg:gogoproto-remove

Conversation

@jsternberg
Copy link
Copy Markdown
Collaborator

@jsternberg jsternberg commented Sep 26, 2024

Removes gogo/protobuf from buildx and updates to a version of
moby/buildkit where gogo is removed.

This also changes how the proto files are generated. This is because
newer versions of protobuf are more strict about name conflicts. If two
files have the same name (even if they are relative paths) and are used
in different protoc commands, they'll conflict in the registry.

Since protobuf file generation doesn't work very well with
paths=source_relative, this removes the go:generate expression and
just relies on the dockerfile to perform the generation.

@jsternberg jsternberg changed the title vendor: update moby/buildkit for gogo proto removal protobuf: remove gogoproto Sep 26, 2024
@jsternberg jsternberg force-pushed the gogoproto-remove branch 4 times, most recently from 5c304ae to 3cb79af Compare September 27, 2024 02:44
@jsternberg jsternberg marked this pull request as ready for review September 27, 2024 15:04
Comment thread go.mod Outdated
go 1.21.0
go 1.22.0

toolchain go1.22.2
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove toolchain, see #2577 (review)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm honestly not even sure what added this.

Removes gogo/protobuf from buildx and updates to a version of
moby/buildkit where gogo is removed.

This also changes how the proto files are generated. This is because
newer versions of protobuf are more strict about name conflicts. If two
files have the same name (even if they are relative paths) and are used
in different protoc commands, they'll conflict in the registry.

Since protobuf file generation doesn't work very well with
`paths=source_relative`, this removes the `go:generate` expression and
just relies on the dockerfile to perform the generation.

Signed-off-by: Jonathan A. Sternberg <[email protected]>
Copy link
Copy Markdown
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

Some follow-ups but I think we can bring this in.

Comment thread build/url.go
return nil, err
}
if stat.Size() > 512*1024 {
if proto.Size(stat) > 512*1024 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is meant to be file size. We also should probably increase the limit (in a different PR).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Comment thread commands/prune.go
flags.BoolVarP(&options.all, "all", "a", false, "Include internal/frontend images")
flags.Var(&options.filter, "filter", `Provide filter values (e.g., "until=24h")`)
flags.Var(&options.keepStorage, "keep-storage", "Amount of disk space to keep for cache")
flags.Var(&options.minStorage, "min-storage", "Minimum amount of disk space to keep for cache")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This part needs updates based on moby/buildkit#5359

Not a blocker but need to make sure we don't ship this version.

Comment thread controller/pb/progress.go
func digestSliceFromPB(elems []string) []digest.Digest {
clone := make([]digest.Digest, len(elems))
for i, e := range elems {
clone[i] = digest.Digest(e)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally all digest casts(when data comes from API) go through digest.Parse. There was a similar follow-up to buildkit PR.

@tonistiigi tonistiigi merged commit 1db8f67 into docker:master Oct 2, 2024
@jsternberg jsternberg deleted the gogoproto-remove branch October 2, 2024 23:04
jsternberg added a commit to jsternberg/buildkit that referenced this pull request Oct 3, 2024
The relative paths option for protoc generators doesn't work well when
it comes to dependencies. This simplifies the code generation to avoid
using `go generate` and to use one global command for protoc generation.

This is similar to docker/buildx#2713 since the
same problems with code generation occur here too.

Signed-off-by: Jonathan A. Sternberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants