mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 21:47:13 +08:00
protobuf: remove gogoproto
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>
This commit is contained in:
13
vendor/google.golang.org/protobuf/compiler/protogen/protogen.go
generated
vendored
13
vendor/google.golang.org/protobuf/compiler/protogen/protogen.go
generated
vendored
@ -19,7 +19,7 @@ import (
|
||||
"go/printer"
|
||||
"go/token"
|
||||
"go/types"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
@ -60,7 +60,7 @@ func run(opts Options, f func(*Plugin) error) error {
|
||||
if len(os.Args) > 1 {
|
||||
return fmt.Errorf("unknown argument %q (this program should be run by protoc, not directly)", os.Args[1])
|
||||
}
|
||||
in, err := ioutil.ReadAll(os.Stdin)
|
||||
in, err := io.ReadAll(os.Stdin)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -108,6 +108,9 @@ type Plugin struct {
|
||||
// google.protobuf.CodeGeneratorResponse.supported_features for details.
|
||||
SupportedFeatures uint64
|
||||
|
||||
SupportedEditionsMinimum descriptorpb.Edition
|
||||
SupportedEditionsMaximum descriptorpb.Edition
|
||||
|
||||
fileReg *protoregistry.Files
|
||||
enumsByName map[protoreflect.FullName]*Enum
|
||||
messagesByName map[protoreflect.FullName]*Message
|
||||
@ -140,7 +143,7 @@ type Options struct {
|
||||
// opts := &protogen.Options{
|
||||
// ParamFunc: flags.Set,
|
||||
// }
|
||||
// protogen.Run(opts, func(p *protogen.Plugin) error {
|
||||
// opts.Run(func(p *protogen.Plugin) error {
|
||||
// if *value { ... }
|
||||
// })
|
||||
ParamFunc func(name, value string) error
|
||||
@ -396,6 +399,10 @@ func (gen *Plugin) Response() *pluginpb.CodeGeneratorResponse {
|
||||
if gen.SupportedFeatures > 0 {
|
||||
resp.SupportedFeatures = proto.Uint64(gen.SupportedFeatures)
|
||||
}
|
||||
if gen.SupportedEditionsMinimum != descriptorpb.Edition_EDITION_UNKNOWN && gen.SupportedEditionsMaximum != descriptorpb.Edition_EDITION_UNKNOWN {
|
||||
resp.MinimumEdition = proto.Int32(int32(gen.SupportedEditionsMinimum))
|
||||
resp.MaximumEdition = proto.Int32(int32(gen.SupportedEditionsMaximum))
|
||||
}
|
||||
return resp
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user