vendor: github.com/moby/buildkit v0.12.0

full diff: https://github.com/moby/buildkit/compare/20230620112432...v0.12.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2023-07-17 10:49:00 +02:00
parent f53202196c
commit 2717d897ee
617 changed files with 86375 additions and 268 deletions

View File

@@ -0,0 +1 @@
package hcserror

View File

@@ -0,0 +1,52 @@
//go:build windows
package hcserror
import (
"errors"
"fmt"
"golang.org/x/sys/windows"
)
type HcsError struct {
title string
rest string
Err error
}
func (e *HcsError) Error() string {
s := e.title
if len(s) > 0 && s[len(s)-1] != ' ' {
s += " "
}
s += fmt.Sprintf("failed in Win32: %s (0x%x)", e.Err, Win32FromError(e.Err))
if e.rest != "" {
if e.rest[0] != ' ' {
s += " "
}
s += e.rest
}
return s
}
func New(err error, title, rest string) error {
// Pass through DLL errors directly since they do not originate from HCS.
var e *windows.DLLError
if errors.As(err, &e) {
return err
}
return &HcsError{title, rest, err}
}
func Win32FromError(err error) uint32 {
var herr *HcsError
if errors.As(err, &herr) {
return Win32FromError(herr.Err)
}
var code windows.Errno
if errors.As(err, &code) {
return uint32(code)
}
return uint32(windows.ERROR_GEN_FAILURE)
}