vendor: github.com/moby/buildkit v0.21.0-rc1

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
Jonathan A. Sternberg
2025-04-09 10:28:03 -05:00
parent a34cdff84e
commit 8fb1157b5f
221 changed files with 6530 additions and 3986 deletions

View File

@ -12,7 +12,7 @@ func (e *OpError) Unwrap() error {
return e.error
}
func WithOp(err error, anyOp interface{}, opDesc map[string]string) error {
func WithOp(err error, anyOp any, opDesc map[string]string) error {
op, ok := anyOp.(*pb.Op)
if err == nil || !ok {
return err

View File

@ -98,10 +98,7 @@ func (s *Source) Print(w io.Writer) error {
func containsLine(rr []*pb.Range, l int) bool {
for _, r := range rr {
e := r.End.Line
if e < r.Start.Line {
e = r.Start.Line
}
e := max(r.End.Line, r.Start.Line)
if r.Start.Line <= int32(l) && e >= int32(l) {
return true
}
@ -112,10 +109,7 @@ func containsLine(rr []*pb.Range, l int) bool {
func getStartEndLine(rr []*pb.Range) (start int, end int, ok bool) {
first := true
for _, r := range rr {
e := r.End.Line
if e < r.Start.Line {
e = r.Start.Line
}
e := max(r.End.Line, r.Start.Line)
if first || int(r.Start.Line) < start {
start = int(r.Start.Line)
}

View File

@ -20,6 +20,8 @@ const AttrHTTPFilename = "http.filename"
const AttrHTTPPerm = "http.perm"
const AttrHTTPUID = "http.uid"
const AttrHTTPGID = "http.gid"
const AttrHTTPAuthHeaderSecret = "http.authheadersecret"
const AttrHTTPHeaderPrefix = "http.header."
const AttrImageResolveMode = "image.resolvemode"
const AttrImageResolveModeDefault = "default"

View File

@ -31,9 +31,12 @@ const (
CapSourceGitSubdir apicaps.CapID = "source.git.subdir"
CapSourceHTTP apicaps.CapID = "source.http"
CapSourceHTTPAuth apicaps.CapID = "source.http.auth"
CapSourceHTTPChecksum apicaps.CapID = "source.http.checksum"
CapSourceHTTPPerm apicaps.CapID = "source.http.perm"
CapSourceHTTPUIDGID apicaps.CapID = "soruce.http.uidgid"
// NOTE the historical typo
CapSourceHTTPUIDGID apicaps.CapID = "soruce.http.uidgid"
CapSourceHTTPHeader apicaps.CapID = "source.http.header"
CapSourceOCILayout apicaps.CapID = "source.ocilayout"
@ -230,7 +233,7 @@ func init() {
})
Caps.Init(apicaps.Cap{
ID: CapSourceOCILayout,
ID: CapSourceHTTPAuth,
Enabled: true,
Status: apicaps.CapStatusExperimental,
})
@ -241,6 +244,18 @@ func init() {
Status: apicaps.CapStatusExperimental,
})
Caps.Init(apicaps.Cap{
ID: CapSourceHTTPHeader,
Enabled: true,
Status: apicaps.CapStatusExperimental,
})
Caps.Init(apicaps.Cap{
ID: CapSourceOCILayout,
Enabled: true,
Status: apicaps.CapStatusExperimental,
})
Caps.Init(apicaps.Cap{
ID: CapBuildOpLLBFileName,
Enabled: true,

View File

@ -1,6 +1,8 @@
package pb
import (
"slices"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
)
@ -12,7 +14,7 @@ func (p *Platform) Spec() ocispecs.Platform {
OSVersion: p.OSVersion,
}
if p.OSFeatures != nil {
result.OSFeatures = append([]string{}, p.OSFeatures...)
result.OSFeatures = slices.Clone(p.OSFeatures)
}
return result
}
@ -25,7 +27,7 @@ func PlatformFromSpec(p ocispecs.Platform) *Platform {
OSVersion: p.OSVersion,
}
if p.OSFeatures != nil {
result.OSFeatures = append([]string{}, p.OSFeatures...)
result.OSFeatures = slices.Clone(p.OSFeatures)
}
return result
}