Browse code

[19.03] vendor: buildkit v0.6.4-5-g59e305aa

full diff: https://github.com/moby/buildkit/compare/b26cff2413cc6a466f8739262efa13bd126f8fc7...59e305aa33fd96e51d5c458f55104250b3e39f56

- moby/buildkit#1469 Avoid creation of irrelevant temporary files on Windows
- backport of moby/buildkit#1462 for the docker-19.03/v0.6 branch

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2020/05/01 00:13:00
Showing 4 changed files
... ...
@@ -26,7 +26,7 @@ github.com/imdario/mergo                            7c29201646fa3de8506f70121347
26 26
 golang.org/x/sync                                   e225da77a7e68af35c70ccbf71af2b83e6acac3c
27 27
 
28 28
 # buildkit
29
-github.com/moby/buildkit                            b26cff2413cc6a466f8739262efa13bd126f8fc7 # v0.6.4 + aa7df97d7136e732561b59f87a38ad52d46d3b19
29
+github.com/moby/buildkit                            59e305aa33fd96e51d5c458f55104250b3e39f56 # v0.6.4-5-g59e305aa
30 30
 github.com/tonistiigi/fsutil                        6c909ab392c173a4264ae1bfcbc0450b9aac0c7d
31 31
 github.com/grpc-ecosystem/grpc-opentracing          8e809c8a86450a29b90dcc9efbf062d0fe6d9746
32 32
 github.com/opentracing/opentracing-go               1361b9cd60be79c4c3a7fa9841b3c132e40066a7
33 33
deleted file mode 100644
... ...
@@ -1,42 +0,0 @@
1
-package binfmt_misc
2
-
3
-import (
4
-	"bytes"
5
-	"compress/gzip"
6
-	"io"
7
-	"io/ioutil"
8
-	"os"
9
-	"os/exec"
10
-	"path/filepath"
11
-)
12
-
13
-func check(bin string) error {
14
-	tmpdir, err := ioutil.TempDir("", "qemu-check")
15
-	if err != nil {
16
-		return err
17
-	}
18
-	defer os.RemoveAll(tmpdir)
19
-	pp := filepath.Join(tmpdir, "check")
20
-
21
-	r, err := gzip.NewReader(bytes.NewReader([]byte(bin)))
22
-	if err != nil {
23
-		return err
24
-	}
25
-	defer r.Close()
26
-
27
-	f, err := os.OpenFile(pp, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0700)
28
-	if err != nil {
29
-		return err
30
-	}
31
-
32
-	if _, err := io.Copy(f, r); err != nil {
33
-		f.Close()
34
-		return err
35
-	}
36
-	f.Close()
37
-
38
-	cmd := exec.Command("/check")
39
-	withChroot(cmd, tmpdir)
40
-	err = cmd.Run()
41
-	return err
42
-}
... ...
@@ -3,7 +3,13 @@
3 3
 package binfmt_misc
4 4
 
5 5
 import (
6
+	"bytes"
7
+	"compress/gzip"
8
+	"io"
9
+	"io/ioutil"
10
+	"os"
6 11
 	"os/exec"
12
+	"path/filepath"
7 13
 	"syscall"
8 14
 )
9 15
 
... ...
@@ -12,3 +18,34 @@ func withChroot(cmd *exec.Cmd, dir string) {
12 12
 		Chroot: dir,
13 13
 	}
14 14
 }
15
+
16
+func check(bin string) error {
17
+	tmpdir, err := ioutil.TempDir("", "qemu-check")
18
+	if err != nil {
19
+		return err
20
+	}
21
+	defer os.RemoveAll(tmpdir)
22
+	pp := filepath.Join(tmpdir, "check")
23
+
24
+	r, err := gzip.NewReader(bytes.NewReader([]byte(bin)))
25
+	if err != nil {
26
+		return err
27
+	}
28
+	defer r.Close()
29
+
30
+	f, err := os.OpenFile(pp, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0700)
31
+	if err != nil {
32
+		return err
33
+	}
34
+
35
+	if _, err := io.Copy(f, r); err != nil {
36
+		f.Close()
37
+		return err
38
+	}
39
+	f.Close()
40
+
41
+	cmd := exec.Command("/check")
42
+	withChroot(cmd, tmpdir)
43
+	err = cmd.Run()
44
+	return err
45
+}
... ...
@@ -3,8 +3,13 @@
3 3
 package binfmt_misc
4 4
 
5 5
 import (
6
+	"errors"
6 7
 	"os/exec"
7 8
 )
8 9
 
9 10
 func withChroot(cmd *exec.Cmd, dir string) {
10 11
 }
12
+
13
+func check(bin string) error {
14
+	return errors.New("binfmt is not supported on Windows")
15
+}