mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to 8397d0b9
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
8
vendor/github.com/moby/buildkit/frontend/dockerfile/linter/linter.go
generated
vendored
8
vendor/github.com/moby/buildkit/frontend/dockerfile/linter/linter.go
generated
vendored
@ -39,7 +39,7 @@ func New(config *Config) *Linter {
|
||||
}
|
||||
|
||||
func (lc *Linter) Run(rule LinterRuleI, location []parser.Range, txt ...string) {
|
||||
if lc == nil || lc.Warn == nil || lc.SkipAll {
|
||||
if lc == nil || lc.Warn == nil || lc.SkipAll || rule.IsDeprecated() {
|
||||
return
|
||||
}
|
||||
rulename := rule.RuleName()
|
||||
@ -71,11 +71,13 @@ func (lc *Linter) Error() error {
|
||||
type LinterRuleI interface {
|
||||
RuleName() string
|
||||
Run(warn LintWarnFunc, location []parser.Range, txt ...string)
|
||||
IsDeprecated() bool
|
||||
}
|
||||
|
||||
type LinterRule[F any] struct {
|
||||
Name string
|
||||
Description string
|
||||
Deprecated bool
|
||||
URL string
|
||||
Format F
|
||||
}
|
||||
@ -92,6 +94,10 @@ func (rule *LinterRule[F]) Run(warn LintWarnFunc, location []parser.Range, txt .
|
||||
warn(rule.Name, rule.Description, rule.URL, short, location)
|
||||
}
|
||||
|
||||
func (rule *LinterRule[F]) IsDeprecated() bool {
|
||||
return rule.Deprecated
|
||||
}
|
||||
|
||||
func LintFormatShort(rulename, msg string, line int) string {
|
||||
msg = fmt.Sprintf("%s: %s", rulename, msg)
|
||||
if line > 0 {
|
||||
|
4
vendor/github.com/moby/buildkit/session/filesync/diffcopy.go
generated
vendored
4
vendor/github.com/moby/buildkit/session/filesync/diffcopy.go
generated
vendored
@ -21,10 +21,6 @@ type Stream interface {
|
||||
RecvMsg(m interface{}) error
|
||||
}
|
||||
|
||||
func sendDiffCopy(stream Stream, fs fsutil.FS, progress progressCb) error {
|
||||
return errors.WithStack(fsutil.Send(stream.Context(), stream, fs, progress))
|
||||
}
|
||||
|
||||
func newStreamWriter(stream grpc.ClientStream) io.WriteCloser {
|
||||
wc := &streamWriterCloser{ClientStream: stream}
|
||||
return &bufferedWriteCloser{Writer: bufio.NewWriter(wc), Closer: wc}
|
||||
|
13
vendor/github.com/moby/buildkit/session/filesync/diffcopy_unix.go
generated
vendored
Normal file
13
vendor/github.com/moby/buildkit/session/filesync/diffcopy_unix.go
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package filesync
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/tonistiigi/fsutil"
|
||||
)
|
||||
|
||||
func sendDiffCopy(stream Stream, fs fsutil.FS, progress progressCb) error {
|
||||
return errors.WithStack(fsutil.Send(stream.Context(), stream, fs, progress))
|
||||
}
|
21
vendor/github.com/moby/buildkit/session/filesync/diffcopy_windows.go
generated
vendored
Normal file
21
vendor/github.com/moby/buildkit/session/filesync/diffcopy_windows.go
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
|
||||
package filesync
|
||||
|
||||
import (
|
||||
"github.com/Microsoft/go-winio"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/tonistiigi/fsutil"
|
||||
)
|
||||
|
||||
func sendDiffCopy(stream Stream, fs fsutil.FS, progress progressCb) error {
|
||||
// adding one SeBackupPrivilege to the process so as to be able
|
||||
// to run the subsequent goroutines in fsutil.Send that need
|
||||
// to copy over special Windows metadata files.
|
||||
// TODO(profnandaa): need to cross-check that this cannot be
|
||||
// exploited in any way.
|
||||
winio.EnableProcessPrivileges([]string{winio.SeBackupPrivilege})
|
||||
defer winio.DisableProcessPrivileges([]string{winio.SeBackupPrivilege})
|
||||
return errors.WithStack(fsutil.Send(stream.Context(), stream, fs, progress))
|
||||
}
|
Reference in New Issue
Block a user