mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 13:37:08 +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:
11
vendor/google.golang.org/protobuf/reflect/protodesc/editions.go
generated
vendored
11
vendor/google.golang.org/protobuf/reflect/protodesc/editions.go
generated
vendored
@ -17,11 +17,6 @@ import (
|
||||
gofeaturespb "google.golang.org/protobuf/types/gofeaturespb"
|
||||
)
|
||||
|
||||
const (
|
||||
SupportedEditionsMinimum = descriptorpb.Edition_EDITION_PROTO2
|
||||
SupportedEditionsMaximum = descriptorpb.Edition_EDITION_2023
|
||||
)
|
||||
|
||||
var defaults = &descriptorpb.FeatureSetDefaults{}
|
||||
var defaultsCacheMu sync.Mutex
|
||||
var defaultsCache = make(map[filedesc.Edition]*descriptorpb.FeatureSet)
|
||||
@ -67,18 +62,20 @@ func getFeatureSetFor(ed filedesc.Edition) *descriptorpb.FeatureSet {
|
||||
fmt.Fprintf(os.Stderr, "internal error: unsupported edition %v (did you forget to update the embedded defaults (i.e. the bootstrap descriptor proto)?)\n", edpb)
|
||||
os.Exit(1)
|
||||
}
|
||||
fs := defaults.GetDefaults()[0].GetFeatures()
|
||||
fsed := defaults.GetDefaults()[0]
|
||||
// Using a linear search for now.
|
||||
// Editions are guaranteed to be sorted and thus we could use a binary search.
|
||||
// Given that there are only a handful of editions (with one more per year)
|
||||
// there is not much reason to use a binary search.
|
||||
for _, def := range defaults.GetDefaults() {
|
||||
if def.GetEdition() <= edpb {
|
||||
fs = def.GetFeatures()
|
||||
fsed = def
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
fs := proto.Clone(fsed.GetFixedFeatures()).(*descriptorpb.FeatureSet)
|
||||
proto.Merge(fs, fsed.GetOverridableFeatures())
|
||||
defaultsCache[ed] = fs
|
||||
return fs
|
||||
}
|
||||
|
Reference in New Issue
Block a user