Skip to content

fssync SyncedDir API for skipping entire dirs #2837

@nicks

Description

@nicks

feature request for the filesync package: https://github.com/moby/buildkit/tree/master/session/filesync

We've been using the SyncedDir API with a lot of success to add additional filters on the build context.

https://pkg.go.dev/github.com/moby/buildkit/session/filesync#SyncedDir

In particular, the Map func(string, *fstypes.Stat) bool function has been really helpful.

One thing that we've wanted to be able to do is also tell the filesync Provider "don't even bother stat'ing this directory, there are no files to include there". Something like MapSkipDir func(string, *fstypes.Stat) bool.

Would you be open to an API like this? We'd be happy to add it if it seems reasonable.

There's already some optimizations in the underlying library to skip directories: https://github.com/tonistiigi/fsutil/blob/master/walker.go#L209
but it's a bit fragile, and too easy to accidentally kick down the slow path.

Sorry if this is all a bit pointy-headed and esoteric, happy to explain more if it's not clear.

Motivating issue: tilt-dev/tilt#5745

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions