[Darwin] Use FSEvents when target_os has no version number - #598
Open
klizas wants to merge 1 commit into
Open
Conversation
houndci-bot
reviewed
Aug 19, 2026
|
我已收到你的邮件,谢谢!
|
Ruby configured with `--with-os-version-style=none` reports a bare `darwin` in `RbConfig::CONFIG['target_os']` instead of e.g. `darwin24`. `OS_REGEXP` required `(1|2)\d+`, so `usable?` returned false on those builds and Listen fell back to polling.
klizas
force-pushed
the
darwin-adapter-optional-os-version
branch
from
August 19, 2026 18:39
05c0379 to
05d2962
Compare
klizas
marked this pull request as ready for review
August 19, 2026 18:45
target_os has no version numbertarget_os has no version number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Ruby configured with
--with-os-version-style=none,RbConfig::CONFIG['target_os']is a baredarwinrather than e.g.darwin24.OS_REGEXPrequired(1|2)\d+, sousable?returned false, and since no other adapter is usable on macOS, Listen fell back to polling.Distributors use that configure option so
RUBY_PLATFORMstays stable across macOS releases, where it is otherwise derived from the build machine's kernel. Either waytarget_osis a cosmetic build string, so it says nothing about whether FSEvents is available.This PR makes the version optional and treats an absent version as usable. The
rb-fseventcheck still runs when a version is present and older than darwin13, so OS X 10.6-10.8 is unaffected.\Ais needed because an optional capture group would otherwise let the pattern matchdarwinanywhere in the string. As a side effect the pattern now also matchesdarwin30and later, which(1|2)\d+did not.