Skip to content

Conversation

@pixelspark
Copy link
Contributor

Purpose

On iOS, the FSEvents API for watching files (also used on macOS) is not available, but kqueue is. This PR ensures kqueue support is built on iOS instead of the FSEvents based watcher implementation.

Before this PR, you could already use the kqueue build option to force its usage. Unfortunately gomobile, the tool that I use to build Syncthing for iOS and macOS for Synctrain, does not support setting different build flags for iOS and macOS (unless I build separately for each, which is a bit of a hassle because XCode nonsense). I am assuming there are good reasons to support FSEvents even though kqueue is also available on macOS (but I'm not sure why?). I do know FSEvents has been working fine for me on macOS so it seems best to use FSEvents on macOS and kqueue on iOS.

Note that this also requires syncthing/notify#4 to be merged in synchting/notify (until that is done, this PR will fail to build on iOS due to notify still trying to link to fsevents stuff when the kqueue build flag is not set).

Testing

I compiled both syncthing/notify and syncthing with this PR applied, and used that to successfully build the Synctrain iOS app, which after this PR works fine and should follow up file changes a bit quicker.

Screenshots

n/a

Documentation

n/a

Authorship

Your name and email will be added automatically to the AUTHORS file
based on the commit metadata.

@calmh
Copy link
Member

calmh commented Feb 7, 2025

Looks reasonable. IIRC, we use fsevents on macOS because it's better (uses less resources), but kqueue is fine as well.

@calmh
Copy link
Member

calmh commented Feb 7, 2025

I merged the notify pr, so you could update the dependency here.

@pixelspark
Copy link
Contributor Author

OK, all done

@calmh calmh enabled auto-merge (squash) February 7, 2025 15:29
@calmh calmh merged commit 28f0cff into syncthing:main Feb 7, 2025
24 checks passed
@pixelspark pixelspark deleted the ios-kqueue branch February 7, 2025 18:48
@calmh calmh added this to the v1.29.3 milestone Mar 9, 2025
calmh added a commit that referenced this pull request Mar 10, 2025
* main: (25 commits)
  refactor(api): make shutdown timeout configurable for tests (#9980)
  refactor(api): deduplicate HTTP test helpers and allow session cookie access (#9977)
  build: correct API call for Weblate statistics
  build(deps): update dependencies (#9978)
  chore(etc): remove /usr/bin prefix from Linux .desktop files (#9966)
  build: use Go 1.24, minimum is Go 1.23 (#9960)
  fix(policy): do not require multiple maintainers for build changes
  chore(gui, man, authors): update docs, translations, and contributors
  chore(fs): build kqueue instead of fsevents watcher on iOS (#9950)
  build(deps): update dependencies (#9951)
  refactor: using slices.Contains to simplify the code (#9918)
  build: switch to cloud code signing for Windows (#9948)
  chore(gui, man, authors): update docs, translations, and contributors
  chore(gui, man, authors): update docs, translations, and contributors
  fix(model): clarify errors on Windows user/group lookup (fixes #9929) (#9930)
  chore(gui, man, authors): update docs, translations, and contributors
  chore(scanner): don't warn about cancelled scan (#9920)
  chore(gui, man, authors): update docs, translations, and contributors
  chore(proto): change symlinktarget to be byte sequence (fixes #9913) (#9914)
  fix(api): don't crash requests after failing to unmarshal tokens (fixes #9909) (#9912)
  ...
calmh added a commit to p0l0us/syncthing that referenced this pull request Mar 28, 2025
* main: (175 commits)
  build: move nightly build schedule to separate workflow (syncthing#10000)
  chore(syncthing): use file lock on certificate to prevent multiple instances (syncthing#10003)
  chore(ur): add RSS to reported stats (syncthing#10002)
  chore(gui, man, authors): update docs, translations, and contributors
  chore(gui, man, authors): update docs, translations, and contributors
  fix(api): prevent tilde expansion in path suggestions (fixes syncthing#9990) (syncthing#9992)
  fix(syncthing): don't auto upgrade to higher major on startup (syncthing#9989)
  build(deps): update dependencies (syncthing#9988)
  chore(gui, man, authors): update docs, translations, and contributors
  refactor(api): extract method configMuxBuilder.postAdjustGui and add test coverage (syncthing#9979)
  refactor(api): make shutdown timeout configurable for tests (syncthing#9980)
  refactor(api): deduplicate HTTP test helpers and allow session cookie access (syncthing#9977)
  build: correct API call for Weblate statistics
  build(deps): update dependencies (syncthing#9978)
  chore(etc): remove /usr/bin prefix from Linux .desktop files (syncthing#9966)
  build: use Go 1.24, minimum is Go 1.23 (syncthing#9960)
  fix(policy): do not require multiple maintainers for build changes
  chore(gui, man, authors): update docs, translations, and contributors
  chore(fs): build kqueue instead of fsevents watcher on iOS (syncthing#9950)
  build(deps): update dependencies (syncthing#9951)
  ...
calmh added a commit to tomasz1986/syncthing that referenced this pull request Mar 28, 2025
…-is-disabled-for-Send-Only-folders

* main: (266 commits)
  build: move nightly build schedule to separate workflow (syncthing#10000)
  chore(syncthing): use file lock on certificate to prevent multiple instances (syncthing#10003)
  chore(ur): add RSS to reported stats (syncthing#10002)
  chore(gui, man, authors): update docs, translations, and contributors
  chore(gui, man, authors): update docs, translations, and contributors
  fix(api): prevent tilde expansion in path suggestions (fixes syncthing#9990) (syncthing#9992)
  fix(syncthing): don't auto upgrade to higher major on startup (syncthing#9989)
  build(deps): update dependencies (syncthing#9988)
  chore(gui, man, authors): update docs, translations, and contributors
  refactor(api): extract method configMuxBuilder.postAdjustGui and add test coverage (syncthing#9979)
  refactor(api): make shutdown timeout configurable for tests (syncthing#9980)
  refactor(api): deduplicate HTTP test helpers and allow session cookie access (syncthing#9977)
  build: correct API call for Weblate statistics
  build(deps): update dependencies (syncthing#9978)
  chore(etc): remove /usr/bin prefix from Linux .desktop files (syncthing#9966)
  build: use Go 1.24, minimum is Go 1.23 (syncthing#9960)
  fix(policy): do not require multiple maintainers for build changes
  chore(gui, man, authors): update docs, translations, and contributors
  chore(fs): build kqueue instead of fsevents watcher on iOS (syncthing#9950)
  build(deps): update dependencies (syncthing#9951)
  ...
@calmh calmh added the chore label May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants