file system watching on linux fails to avoid placing marks from different mounts into the same fanotify descriptor #20670
Labels
bug
Observed behavior contradicts documented or intended behavior
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
os-linux
zig build system
std.Build, the build runner, `zig build` subcommand, package management
Milestone
Follow-up from #20580.
name_to_handle_at
gives us a mount ID here:zig/lib/std/Build/Watch.zig
Line 101 in 8ab70f8
A given fanotify file descriptor (created by
fanotify_init
) can only contain marks from the same mount ID. So if we get a different mount ID here, we need to put it into a new fanotify set. The poll later on needs to poll all of them.Without this fix, we get errors such as
Some commonly used Linux distributions will put the Zig standard library into a different mount than the user's home directory, resulting in this problem.
Workaround:
You can apply this workaround without recompiling Zig.
Related:
The text was updated successfully, but these errors were encountered: