-
Notifications
You must be signed in to change notification settings - Fork 483
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
protobuf: remove gogoproto #2713
Conversation
9a4812a
to
993e9a8
Compare
993e9a8
to
1e2cd95
Compare
5c304ae
to
3cb79af
Compare
go.mod
Outdated
go 1.21.0 | ||
go 1.22.0 | ||
|
||
toolchain go1.22.2 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
3cb79af
to
3af7537
Compare
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 <jonathan.sternberg@docker.com>
3af7537
to
b35a0f4
Compare
There was a problem hiding this 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.
@@ -43,7 +44,7 @@ func createTempDockerfileFromURL(ctx context.Context, d *driver.DriverHandle, ur | |||
if err != nil { | |||
return nil, err | |||
} | |||
if stat.Size() > 512*1024 { | |||
if proto.Size(stat) > 512*1024 { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -148,10 +149,14 @@ func pruneCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command { | |||
flags := cmd.Flags() | |||
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") |
There was a problem hiding this comment.
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.
func digestSliceFromPB(elems []string) []digest.Digest { | ||
clone := make([]digest.Digest, len(elems)) | ||
for i, e := range elems { | ||
clone[i] = digest.Digest(e) |
There was a problem hiding this comment.
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.
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 <jonathan.sternberg@docker.com>
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 thego:generate
expression andjust relies on the dockerfile to perform the generation.