Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support darwin20 / macOS Big Sur #478

Closed
christiankn opened this issue Jul 21, 2020 · 2 comments
Closed

Support darwin20 / macOS Big Sur #478

christiankn opened this issue Jul 21, 2020 · 2 comments

Comments

@christiankn
Copy link
Contributor

christiankn commented Jul 21, 2020

Listen doesn't identify macOS 10.16/11.0 as compatible with the Darwin-adapter because of version number change, and falls back to polling.

The Darwin-adapter checks target_os for version compatibility by looking for versions starting with "1", capturing [10,19].

macOS Big Sur has a target_os of "darwin20", failing to be captured by the regex and causing listen to fall back to polling.

#listen/adapter/darwin.rb
OS_REGEXP = /darwin(?<major_version>1\d+)/i
#(...)
version = RbConfig::CONFIG['target_os'][OS_REGEXP, :major_version]
return false unless version
return true if version.to_i >= 13 # darwin13 is OS X 10.9

Could be fixed by changing the regex, assuming there are no other reasons adapter should break on Big Sur.

OS_REGEXP = /darwin(?<major_version>(1|2)\d+)/i

Notes:
This issue naturally causes high CPU-usage on Rails for developers upgrading to macOS Big Sur, when application is not properly configured to use Polling.

It seems to be working as expected with the above change, but I haven't tested it extensively.

@ioquatix
Copy link
Member

This has been merged into master, can you please test it?

@fearoffish
Copy link

@ioquatix Looks good to me. Thanks.

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

No branches or pull requests

3 participants