diff --git a/go.mod b/go.mod index 8aa93470..fdddf176 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 - github.com/tonistiigi/fsutil v0.0.0-20241028165955-397af5306b5c + github.com/tonistiigi/fsutil v0.0.0-20241104203517-8d32dbdd27d3 github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 github.com/zclconf/go-cty v1.14.4 go.opentelemetry.io/otel v1.21.0 diff --git a/go.sum b/go.sum index 9aa621d1..adee6d93 100644 --- a/go.sum +++ b/go.sum @@ -443,8 +443,8 @@ github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4D github.com/theupdateframework/notary v0.7.0/go.mod h1:c9DRxcmhHmVLDay4/2fUYdISnHqbFDGRSlXPO0AhYWw= 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-20241104203517-8d32dbdd27d3 h1:Ce6i+wvnQ0dV5ZPLGYYu/kVYFXEJI+QPy5tJKfU+Q7c= +github.com/tonistiigi/fsutil v0.0.0-20241104203517-8d32dbdd27d3/go.mod h1:Dl/9oEjK7IqnjAm21Okx/XIxUCFJzvh+XdVHUlBwXTw= github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 h1:7I5c2Ig/5FgqkYOh/N87NzoyI9U15qUPXhDD8uCupv8= github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4/go.mod h1:278M4p8WsNh3n4a1eqiFcV2FGk7wE5fwUpUom9mK9lE= github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0= diff --git a/vendor/github.com/tonistiigi/fsutil/.golangci.yml b/vendor/github.com/tonistiigi/fsutil/.golangci.yml index 7300a0e5..b8abb04a 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 a3ba0988..08251ec2 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_openbsd.go b/vendor/github.com/tonistiigi/fsutil/copy/copy_openbsd.go new file mode 100644 index 00000000..18cd438f --- /dev/null +++ b/vendor/github.com/tonistiigi/fsutil/copy/copy_openbsd.go @@ -0,0 +1,38 @@ +//go:build openbsd +// +build openbsd + +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 e90a41d3..cb41247a 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 +// +build solaris darwin freebsd openbsd 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 362142de..37b0840c 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 00000000..c87d789c --- /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 a18986bc..b06550a3 100644 --- a/vendor/github.com/tonistiigi/fsutil/docker-bake.hcl +++ b/vendor/github.com/tonistiigi/fsutil/docker-bake.hcl @@ -6,6 +6,25 @@ 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", + "openbsd/amd64", + "openbsd/arm64", + "windows/amd64", + "windows/arm64" + ] +} + group "default" { targets = ["build"] } @@ -40,6 +59,10 @@ target "lint" { } } +target "lint-cross" { + inherits = ["lint", "_platforms"] +} + target "validate-generated-files" { dockerfile = "./hack/dockerfiles/generated-files.Dockerfile" output = ["type=cacheonly"] @@ -86,6 +109,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 66379bd8..f78016f5 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 074ebca8..9432eb5a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -715,7 +715,7 @@ github.com/theupdateframework/notary/tuf/validation # 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-20241104203517-8d32dbdd27d3 ## explicit; go 1.21 github.com/tonistiigi/fsutil github.com/tonistiigi/fsutil/copy