Skip to content

Conversation

@fschade
Copy link

@fschade fschade commented Dec 30, 2025

The current implementation of watchfs is limited to Linux hosts. While this is generally not an issue, it makes debugging watchfs-related problems on macOS (Darwin) systems difficult or impossible.

This PR introduces experimental support for watchfs on Darwin machines, gated behind the environment variable STORAGE_USERS_POSIX_WATCH_FS=true.

This implementation is not intended for production use, which is why it is hidden a build-time feature flag.

To enable it, build the binary with the Go build tag experimental_watchfs_darwin, for example:

go build -tags=experimental_watchfs_darwin

Alternatively, you can set it globally:

export GOFLAGS="-tags=experimental_watchfs_darwin"

The Darwin implementation has several known limitations:

  • A hard limit of 4096 watched paths; exceeding this can cause missed events.
  • No support for recursive watching, requiring us to manually watch subdirectories, which can be inefficient and resource-intensive.

For these reasons, the feature remains experimental at this time and should only be used for development or debugging purposes on macOS.

_watchfs.mp4

@fschade fschade force-pushed the enhancement-watchfs-for-darwin branch from ffec65f to 3053ad7 Compare December 30, 2025 17:19
@micbar
Copy link

micbar commented Dec 31, 2025

+ make lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | BINDIR=/go/src/github.com/opencloud-eu/reva/toolchain sh -s v1.64.6
golangci/golangci-lint info checking GitHub for tag 'v1.64.6'
golangci/golangci-lint info found version: 1.64.6 for v1.64.6/linux/amd64
golangci/golangci-lint info installed /go/src/github.com/opencloud-eu/reva/toolchain/golangci-lint
/go/src/github.com/opencloud-eu/reva/toolchain/golangci-lint run --timeout [3](https://ci.opencloud.rocks/repos/4/pipeline/172/130#L3)00s
pkg/storage/fs/posix/tree/watch.go:19:6: func `isSubpath` is unused (unused)
func isSubpath(root, p string) bool {
     ^
pkg/storage/fs/posix/tree/watch.go:39:6: func `isPathIgnored` is unused (unused)
func isPathIgnored(tree *Tree, path string) bool {

@fschade fschade force-pushed the enhancement-watchfs-for-darwin branch from 3053ad7 to 099821e Compare December 31, 2025 10:34
@fschade fschade requested a review from aduffeck December 31, 2025 10:47
@fschade fschade force-pushed the enhancement-watchfs-for-darwin branch from 099821e to 0078480 Compare December 31, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants