diff --git a/go.mod b/go.mod index d9e17b87c8c8..96ebc68a3870 100644 --- a/go.mod +++ b/go.mod @@ -69,7 +69,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/spdx/tools-golang v0.5.3 github.com/stretchr/testify v1.9.0 - github.com/tonistiigi/fsutil v0.0.0-20241028165955-397af5306b5c + github.com/tonistiigi/fsutil v0.0.0-20241121093142-31cf1f437184 github.com/tonistiigi/go-actions-cache v0.0.0-20241108014124-394979b8119e github.com/tonistiigi/go-archvariant v1.0.0 github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 diff --git a/go.sum b/go.sum index 35d3a2ef2c4b..19d30dc27820 100644 --- a/go.sum +++ b/go.sum @@ -379,8 +379,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tonistiigi/dchapes-mode v0.0.0-20241001053921-ca0759fec205 h1:eUk79E1w8yMtXeHSzjKorxuC8qJOnyXQnLaJehxpJaI= github.com/tonistiigi/dchapes-mode v0.0.0-20241001053921-ca0759fec205/go.mod h1:3Iuxbr0P7D3zUzBMAZB+ois3h/et0shEz0qApgHYGpY= -github.com/tonistiigi/fsutil v0.0.0-20241028165955-397af5306b5c h1:bQLsfX+uEPZUjyR2qmoJs5F8Z57bPVmF3IsUf22Xo9Y= -github.com/tonistiigi/fsutil v0.0.0-20241028165955-397af5306b5c/go.mod h1:Dl/9oEjK7IqnjAm21Okx/XIxUCFJzvh+XdVHUlBwXTw= +github.com/tonistiigi/fsutil v0.0.0-20241121093142-31cf1f437184 h1:RgyoSI38Y36zjQaszel/0RAcIehAnjA1B0RiUV9SDO4= +github.com/tonistiigi/fsutil v0.0.0-20241121093142-31cf1f437184/go.mod h1:Dl/9oEjK7IqnjAm21Okx/XIxUCFJzvh+XdVHUlBwXTw= github.com/tonistiigi/go-actions-cache v0.0.0-20241108014124-394979b8119e h1:SdcAL/tmv2mIfNhRygmeRrcci3aJQFqNughD7rcV170= github.com/tonistiigi/go-actions-cache v0.0.0-20241108014124-394979b8119e/go.mod h1:xsu+XeKT9piH/5f9Y1Zsv5krQqI34CWkIusbs5027IM= github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0= diff --git a/vendor/github.com/tonistiigi/fsutil/.golangci.yml b/vendor/github.com/tonistiigi/fsutil/.golangci.yml index 7300a0e58268..b8abb04a1c82 100644 --- a/vendor/github.com/tonistiigi/fsutil/.golangci.yml +++ b/vendor/github.com/tonistiigi/fsutil/.golangci.yml @@ -1,7 +1,5 @@ run: - timeout: 10m - skip-files: - - ".*\\.pb\\.go$" + timeout: 30m linters: enable: @@ -25,6 +23,10 @@ linters-settings: - pkg: "io/ioutil" desc: The io/ioutil package has been deprecated. -# show all -max-issues-per-linter: 0 -max-same-issues: 0 +issues: + exclude-files: + - ".*\\.pb\\.go$" + + # show all + max-issues-per-linter: 0 + max-same-issues: 0 diff --git a/vendor/github.com/tonistiigi/fsutil/chtimes_nolinux.go b/vendor/github.com/tonistiigi/fsutil/chtimes_nolinux.go index a3ba09881d59..08251ec22ace 100644 --- a/vendor/github.com/tonistiigi/fsutil/chtimes_nolinux.go +++ b/vendor/github.com/tonistiigi/fsutil/chtimes_nolinux.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux package fsutil diff --git a/vendor/github.com/tonistiigi/fsutil/copy/copy_otherbsd.go b/vendor/github.com/tonistiigi/fsutil/copy/copy_otherbsd.go new file mode 100644 index 000000000000..8e71292b8660 --- /dev/null +++ b/vendor/github.com/tonistiigi/fsutil/copy/copy_otherbsd.go @@ -0,0 +1,38 @@ +//go:build openbsd || netbsd +// +build openbsd netbsd + +package fs + +import ( + "io" + "os" + + "github.com/pkg/errors" + "golang.org/x/sys/unix" +) + +func copyFile(source, target string) error { + src, err := os.Open(source) + if err != nil { + return errors.Wrapf(err, "failed to open source %s", source) + } + defer src.Close() + tgt, err := os.Create(target) + if err != nil { + return errors.Wrapf(err, "failed to open target %s", target) + } + defer tgt.Close() + + return copyFileContent(tgt, src) +} + +func copyFileContent(dst, src *os.File) error { + buf := bufferPool.Get().(*[]byte) + _, err := io.CopyBuffer(dst, src, *buf) + bufferPool.Put(buf) + return err +} + +func mknod(dst string, mode uint32, rDev int) error { + return unix.Mknod(dst, uint32(mode), rDev) +} diff --git a/vendor/github.com/tonistiigi/fsutil/copy/copy_unix.go b/vendor/github.com/tonistiigi/fsutil/copy/copy_unix.go index e90a41d3563a..df1cdd07a2d6 100644 --- a/vendor/github.com/tonistiigi/fsutil/copy/copy_unix.go +++ b/vendor/github.com/tonistiigi/fsutil/copy/copy_unix.go @@ -1,5 +1,5 @@ -//go:build solaris || darwin || freebsd -// +build solaris darwin freebsd +//go:build solaris || darwin || freebsd || openbsd || netbsd +// +build solaris darwin freebsd openbsd netbsd package fs diff --git a/vendor/github.com/tonistiigi/fsutil/copy/stat_bsd.go b/vendor/github.com/tonistiigi/fsutil/copy/stat_bsd.go index 362142de6cf2..37b0840c9c60 100644 --- a/vendor/github.com/tonistiigi/fsutil/copy/stat_bsd.go +++ b/vendor/github.com/tonistiigi/fsutil/copy/stat_bsd.go @@ -1,4 +1,5 @@ -// +build darwin freebsd netbsd openbsd +//go:build darwin || freebsd || netbsd +// +build darwin freebsd netbsd package fs diff --git a/vendor/github.com/tonistiigi/fsutil/copy/stat_openbsd.go b/vendor/github.com/tonistiigi/fsutil/copy/stat_openbsd.go new file mode 100644 index 000000000000..c87d789cd7d1 --- /dev/null +++ b/vendor/github.com/tonistiigi/fsutil/copy/stat_openbsd.go @@ -0,0 +1,18 @@ +//go:build openbsd +// +build openbsd + +package fs + +import ( + "syscall" +) + +// Returns the last-accessed time +func StatAtime(st *syscall.Stat_t) syscall.Timespec { + return st.Atim +} + +// Returns the last-modified time +func StatMtime(st *syscall.Stat_t) syscall.Timespec { + return st.Mtim +} diff --git a/vendor/github.com/tonistiigi/fsutil/docker-bake.hcl b/vendor/github.com/tonistiigi/fsutil/docker-bake.hcl index a18986bc59ea..9b3070685378 100644 --- a/vendor/github.com/tonistiigi/fsutil/docker-bake.hcl +++ b/vendor/github.com/tonistiigi/fsutil/docker-bake.hcl @@ -6,6 +6,27 @@ variable "DESTDIR" { default = "./bin" } +target "_platforms" { + platforms = [ + "darwin/amd64", + "darwin/arm64", + "freebsd/amd64", + "freebsd/arm64", + "linux/386", + "linux/amd64", + "linux/arm", + "linux/arm64", + "linux/ppc64le", + "linux/s390x", + "netbsd/amd64", + "netbsd/arm64", + "openbsd/amd64", + "openbsd/arm64", + "windows/amd64", + "windows/arm64" + ] +} + group "default" { targets = ["build"] } @@ -40,6 +61,10 @@ target "lint" { } } +target "lint-cross" { + inherits = ["lint", "_platforms"] +} + target "validate-generated-files" { dockerfile = "./hack/dockerfiles/generated-files.Dockerfile" output = ["type=cacheonly"] @@ -86,6 +111,5 @@ target "shfmt" { } target "cross" { - inherits = ["build"] - platforms = ["linux/amd64", "linux/386", "linux/arm64", "linux/arm", "linux/ppc64le", "linux/s390x", "darwin/amd64", "darwin/arm64", "windows/amd64", "windows/arm64", "freebsd/amd64", "freebsd/arm64"] + inherits = ["build", "_platforms"] } diff --git a/vendor/github.com/tonistiigi/fsutil/stat_windows.go b/vendor/github.com/tonistiigi/fsutil/stat_windows.go index 66379bd84c7b..f78016f594db 100644 --- a/vendor/github.com/tonistiigi/fsutil/stat_windows.go +++ b/vendor/github.com/tonistiigi/fsutil/stat_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package fsutil diff --git a/vendor/modules.txt b/vendor/modules.txt index 1d2058ca29ff..430804024966 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -760,7 +760,7 @@ github.com/stretchr/testify/require # github.com/tonistiigi/dchapes-mode v0.0.0-20241001053921-ca0759fec205 ## explicit; go 1.21 github.com/tonistiigi/dchapes-mode -# github.com/tonistiigi/fsutil v0.0.0-20241028165955-397af5306b5c +# github.com/tonistiigi/fsutil v0.0.0-20241121093142-31cf1f437184 ## explicit; go 1.21 github.com/tonistiigi/fsutil github.com/tonistiigi/fsutil/copy