diff --git a/vendor.conf b/vendor.conf index 4d8e25a1da..9b88bbd30a 100644 --- a/vendor.conf +++ b/vendor.conf @@ -26,7 +26,7 @@ github.com/imdario/mergo 7c29201646fa3de8506f70121347 golang.org/x/sync e225da77a7e68af35c70ccbf71af2b83e6acac3c # buildkit -github.com/moby/buildkit b26cff2413cc6a466f8739262efa13bd126f8fc7 # v0.6.4 + aa7df97d7136e732561b59f87a38ad52d46d3b19 +github.com/moby/buildkit 59e305aa33fd96e51d5c458f55104250b3e39f56 # v0.6.4-5-g59e305aa github.com/tonistiigi/fsutil 6c909ab392c173a4264ae1bfcbc0450b9aac0c7d github.com/grpc-ecosystem/grpc-opentracing 8e809c8a86450a29b90dcc9efbf062d0fe6d9746 github.com/opentracing/opentracing-go 1361b9cd60be79c4c3a7fa9841b3c132e40066a7 diff --git a/vendor/github.com/moby/buildkit/util/binfmt_misc/check.go b/vendor/github.com/moby/buildkit/util/binfmt_misc/check.go deleted file mode 100644 index 4caf59449b..0000000000 --- a/vendor/github.com/moby/buildkit/util/binfmt_misc/check.go +++ /dev/null @@ -1,42 +0,0 @@ -package binfmt_misc - -import ( - "bytes" - "compress/gzip" - "io" - "io/ioutil" - "os" - "os/exec" - "path/filepath" -) - -func check(bin string) error { - tmpdir, err := ioutil.TempDir("", "qemu-check") - if err != nil { - return err - } - defer os.RemoveAll(tmpdir) - pp := filepath.Join(tmpdir, "check") - - r, err := gzip.NewReader(bytes.NewReader([]byte(bin))) - if err != nil { - return err - } - defer r.Close() - - f, err := os.OpenFile(pp, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0700) - if err != nil { - return err - } - - if _, err := io.Copy(f, r); err != nil { - f.Close() - return err - } - f.Close() - - cmd := exec.Command("/check") - withChroot(cmd, tmpdir) - err = cmd.Run() - return err -} diff --git a/vendor/github.com/moby/buildkit/util/binfmt_misc/check_unix.go b/vendor/github.com/moby/buildkit/util/binfmt_misc/check_unix.go index 22c7ce7cae..670e6d2c21 100644 --- a/vendor/github.com/moby/buildkit/util/binfmt_misc/check_unix.go +++ b/vendor/github.com/moby/buildkit/util/binfmt_misc/check_unix.go @@ -3,7 +3,13 @@ package binfmt_misc import ( + "bytes" + "compress/gzip" + "io" + "io/ioutil" + "os" "os/exec" + "path/filepath" "syscall" ) @@ -12,3 +18,34 @@ func withChroot(cmd *exec.Cmd, dir string) { Chroot: dir, } } + +func check(bin string) error { + tmpdir, err := ioutil.TempDir("", "qemu-check") + if err != nil { + return err + } + defer os.RemoveAll(tmpdir) + pp := filepath.Join(tmpdir, "check") + + r, err := gzip.NewReader(bytes.NewReader([]byte(bin))) + if err != nil { + return err + } + defer r.Close() + + f, err := os.OpenFile(pp, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0700) + if err != nil { + return err + } + + if _, err := io.Copy(f, r); err != nil { + f.Close() + return err + } + f.Close() + + cmd := exec.Command("/check") + withChroot(cmd, tmpdir) + err = cmd.Run() + return err +} diff --git a/vendor/github.com/moby/buildkit/util/binfmt_misc/check_windows.go b/vendor/github.com/moby/buildkit/util/binfmt_misc/check_windows.go index 3c28c8bdd3..f246184778 100644 --- a/vendor/github.com/moby/buildkit/util/binfmt_misc/check_windows.go +++ b/vendor/github.com/moby/buildkit/util/binfmt_misc/check_windows.go @@ -3,8 +3,13 @@ package binfmt_misc import ( + "errors" "os/exec" ) func withChroot(cmd *exec.Cmd, dir string) { } + +func check(bin string) error { + return errors.New("binfmt is not supported on Windows") +}