mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-12 14:37:08 +08:00
vendor: update buildkit to v0.19.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
57
vendor/github.com/containerd/platforms/compare.go
generated
vendored
57
vendor/github.com/containerd/platforms/compare.go
generated
vendored
@ -31,6 +31,34 @@ type MatchComparer interface {
|
||||
Less(specs.Platform, specs.Platform) bool
|
||||
}
|
||||
|
||||
type platformVersions struct {
|
||||
major []int
|
||||
minor []int
|
||||
}
|
||||
|
||||
var arm64variantToVersion = map[string]platformVersions{
|
||||
"v8": {[]int{8}, []int{0}},
|
||||
"v8.0": {[]int{8}, []int{0}},
|
||||
"v8.1": {[]int{8}, []int{1}},
|
||||
"v8.2": {[]int{8}, []int{2}},
|
||||
"v8.3": {[]int{8}, []int{3}},
|
||||
"v8.4": {[]int{8}, []int{4}},
|
||||
"v8.5": {[]int{8}, []int{5}},
|
||||
"v8.6": {[]int{8}, []int{6}},
|
||||
"v8.7": {[]int{8}, []int{7}},
|
||||
"v8.8": {[]int{8}, []int{8}},
|
||||
"v8.9": {[]int{8}, []int{9}},
|
||||
"v9": {[]int{9, 8}, []int{0, 5}},
|
||||
"v9.0": {[]int{9, 8}, []int{0, 5}},
|
||||
"v9.1": {[]int{9, 8}, []int{1, 6}},
|
||||
"v9.2": {[]int{9, 8}, []int{2, 7}},
|
||||
"v9.3": {[]int{9, 8}, []int{3, 8}},
|
||||
"v9.4": {[]int{9, 8}, []int{4, 9}},
|
||||
"v9.5": {[]int{9, 8}, []int{5, 9}},
|
||||
"v9.6": {[]int{9, 8}, []int{6, 9}},
|
||||
"v9.7": {[]int{9, 8}, []int{7, 9}},
|
||||
}
|
||||
|
||||
// platformVector returns an (ordered) vector of appropriate specs.Platform
|
||||
// objects to try matching for the given platform object (see platforms.Only).
|
||||
func platformVector(platform specs.Platform) []specs.Platform {
|
||||
@ -72,6 +100,33 @@ func platformVector(platform specs.Platform) []specs.Platform {
|
||||
if variant == "" {
|
||||
variant = "v8"
|
||||
}
|
||||
|
||||
vector = []specs.Platform{} // Reset vector, the first variant will be added in loop.
|
||||
arm64Versions, ok := arm64variantToVersion[variant]
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
for i, major := range arm64Versions.major {
|
||||
for minor := arm64Versions.minor[i]; minor >= 0; minor-- {
|
||||
arm64Variant := "v" + strconv.Itoa(major) + "." + strconv.Itoa(minor)
|
||||
if minor == 0 {
|
||||
arm64Variant = "v" + strconv.Itoa(major)
|
||||
}
|
||||
vector = append(vector, specs.Platform{
|
||||
Architecture: "arm64",
|
||||
OS: platform.OS,
|
||||
OSVersion: platform.OSVersion,
|
||||
OSFeatures: platform.OSFeatures,
|
||||
Variant: arm64Variant,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// All arm64/v8.x and arm64/v9.x are compatible with arm/v8 (32-bits) and below.
|
||||
// There's no arm64 v9 variant, so it's normalized to v8.
|
||||
if strings.HasPrefix(variant, "v8") || strings.HasPrefix(variant, "v9") {
|
||||
variant = "v8"
|
||||
}
|
||||
vector = append(vector, platformVector(specs.Platform{
|
||||
Architecture: "arm",
|
||||
OS: platform.OS,
|
||||
@ -87,6 +142,8 @@ func platformVector(platform specs.Platform) []specs.Platform {
|
||||
// Only returns a match comparer for a single platform
|
||||
// using default resolution logic for the platform.
|
||||
//
|
||||
// For arm64/v9.x, will also match arm64/v9.{0..x-1} and arm64/v8.{0..x+5}
|
||||
// For arm64/v8.x, will also match arm64/v8.{0..x-1}
|
||||
// For arm/v8, will also match arm/v7, arm/v6 and arm/v5
|
||||
// For arm/v7, will also match arm/v6 and arm/v5
|
||||
// For arm/v6, will also match arm/v5
|
||||
|
Reference in New Issue
Block a user