Support for task files in Google Drive and similar mounted volumes
To report a bug...
- What command(s) did you run?
task all - What did you expect to happen? Should work
- What actually happened? fcntl F_FULLSYNC error 45: operation not supported
Details
In MacOS, taskwarrior fails if the task data is located in a Google Drive folder. This seems to have been caused by a feature which is not supported by Google Drive - F_FULLSYNC in https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html
(Used in https://github.com/GothenburgBitFactory/libshared/blob/8baf2dbcad9ea24bb9f00a20d912df5da9b45113/src/FS.cpp#L507 ) . Commenting out the code seems to make it work.
Although this can lead to race conditions, using taskwarrior with Google Drive for single person (maybe 2 machines) might not lead to a lot of issues. Can we make this configurable in some way or handle gracefully with warnings?
Thanks for the report! I suppose we could relax the check for the following case:
[EINVAL] fildes refers to a file type (e.g., a socket) that
does not support this operation.
and emit a warning instead of failing completely. Similar situations could happen on linux with certain fuse-based drives, so this should be likely addressed as well.
I ran into this with timewarrior and opened https://github.com/GothenburgBitFactory/libshared/pull/70 which just falls back to fsync if F_FULLFSYNC is not supported by the underlying filesystem.