Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v0.10 backport] vendor tonistiigi/fsutil v0.0.0-20220510150904-0dbf3a8a7d58 #3144

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions client/solve.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/moby/buildkit/util/entitlements"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"github.com/tonistiigi/fsutil"
fstypes "github.com/tonistiigi/fsutil/types"
"go.opentelemetry.io/otel/trace"
"golang.org/x/sync/errgroup"
Expand Down Expand Up @@ -342,10 +343,10 @@ func prepareSyncedDirs(def *llb.Definition, localDirs map[string]string) ([]file
return nil, errors.Errorf("%s not a directory", d)
}
}
resetUIDAndGID := func(p string, st *fstypes.Stat) bool {
resetUIDAndGID := func(p string, st *fstypes.Stat) fsutil.MapResult {
st.Uid = 0
st.Gid = 0
return true
return fsutil.MapResultKeep
}

dirs := make([]filesync.SyncedDir, 0, len(localDirs))
Expand Down
6 changes: 3 additions & 3 deletions exporter/local/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ func (e *localExporterInstance) Export(ctx context.Context, inp exporter.Source,
walkOpt := &fsutil.WalkOpt{}

if idmap != nil {
walkOpt.Map = func(p string, st *fstypes.Stat) bool {
walkOpt.Map = func(p string, st *fstypes.Stat) fsutil.MapResult {
uid, gid, err := idmap.ToContainer(idtools.Identity{
UID: int(st.Uid),
GID: int(st.Gid),
})
if err != nil {
return false
return fsutil.MapResultExclude
}
st.Uid = uint32(uid)
st.Gid = uint32(gid)
return true
return fsutil.MapResultKeep
}
}

Expand Down
6 changes: 3 additions & 3 deletions exporter/tar/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ func (e *localExporterInstance) Export(ctx context.Context, inp exporter.Source,
walkOpt := &fsutil.WalkOpt{}

if idmap != nil {
walkOpt.Map = func(p string, st *fstypes.Stat) bool {
walkOpt.Map = func(p string, st *fstypes.Stat) fsutil.MapResult {
uid, gid, err := idmap.ToContainer(idtools.Identity{
UID: int(st.Uid),
GID: int(st.Gid),
})
if err != nil {
return false
return fsutil.MapResultExclude
}
st.Uid = uint32(uid)
st.Gid = uint32(gid)
return true
return fsutil.MapResultKeep
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ require (
github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
github.com/tonistiigi/fsutil v0.0.0-20220315205639-9ed612626da3
github.com/tonistiigi/fsutil v0.0.0-20220510150904-0dbf3a8a7d58
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7
github.com/tonistiigi/go-archvariant v1.0.0
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1241,8 +1241,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1
github.com/tommy-muehle/go-mnd v1.1.1/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig=
github.com/tonistiigi/fsutil v0.0.0-20201103201449-0834f99b7b85/go.mod h1:a7cilN64dG941IOXfhJhlH0qB92hxJ9A1ewrdUmJ6xo=
github.com/tonistiigi/fsutil v0.0.0-20220315205639-9ed612626da3 h1:T1pEe+WB3SCPVAfVquvfPfagKZU2Z8c1OP3SuGB+id0=
github.com/tonistiigi/fsutil v0.0.0-20220315205639-9ed612626da3/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA=
github.com/tonistiigi/fsutil v0.0.0-20220510150904-0dbf3a8a7d58 h1:rNya5ozLqz0lK46XhmsmqJuxmQLM8dAWabiT+5gZqLY=
github.com/tonistiigi/fsutil v0.0.0-20220510150904-0dbf3a8a7d58/go.mod h1:oPAfvw32vlUJSjyDcQ3Bu0nb2ON2B+G0dtVN/SZNJiA=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7 h1:8eY6m1mjgyB8XySUR7WvebTM8D/Vs86jLJzD/Tw7zkc=
github.com/tonistiigi/go-actions-cache v0.0.0-20220404170428-0bdeb6e1eac7/go.mod h1:qqvyZqkfwkoJuPU/bw61bItaoO0SJ8YSW0vSVRRvsRg=
github.com/tonistiigi/go-archvariant v1.0.0 h1:5LC1eDWiBNflnTF1prCiX09yfNHIxDC/aukdhCdTyb0=
Expand Down
2 changes: 1 addition & 1 deletion session/filesync/filesync.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type SyncedDir struct {
Name string
Dir string
Excludes []string
Map func(string, *fstypes.Stat) bool
Map func(string, *fstypes.Stat) fsutil.MapResult
}

// NewFSSyncProvider creates a new provider for sending files from client
Expand Down
21 changes: 11 additions & 10 deletions vendor/github.com/tonistiigi/fsutil/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/tonistiigi/fsutil/chtimes_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions vendor/github.com/tonistiigi/fsutil/copy/copy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/github.com/tonistiigi/fsutil/copy/copy_darwin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions vendor/github.com/tonistiigi/fsutil/copy/copy_freebsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions vendor/github.com/tonistiigi/fsutil/copy/copy_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions vendor/github.com/tonistiigi/fsutil/copy/copy_nowindows.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions vendor/github.com/tonistiigi/fsutil/copy/device_darwin.go

This file was deleted.

20 changes: 0 additions & 20 deletions vendor/github.com/tonistiigi/fsutil/copy/device_freebsd.go

This file was deleted.

1 change: 1 addition & 0 deletions vendor/github.com/tonistiigi/fsutil/copy/hardlink_unix.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/tonistiigi/fsutil/copy/mkdir_unix.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/tonistiigi/fsutil/copy/stat_sysv.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions vendor/github.com/tonistiigi/fsutil/diskwriter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions vendor/github.com/tonistiigi/fsutil/diskwriter_freebsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/tonistiigi/fsutil/diskwriter_unix.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions vendor/github.com/tonistiigi/fsutil/diskwriter_unixnobsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/tonistiigi/fsutil/docker-bake.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/tonistiigi/fsutil/stat_unix.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading