Open sanemat opened 3 years ago
I'm not sure about minimal reproduce. Could you give me a hand?
Docker Desktop's documentation for their Apple Silicon support says:
However, attempts to run Intel-based containers on Apple Silicon machines under emulation can crash as qemu sometimes fails to run the container. In addition, filesystem change notification APIs (inotify) do not work under qemu emulation. Even when the containers do run correctly under emulation, they will be slower and use more memory than the native equivalent.
(emphasis added)
Sounds like it isn't expected to work, unfortunately.
+1. Multiple folks on my team are impacted by this.
Is there an alternative filesystem change API that can be used?
@sanemat you said:
OK pattern, without listen gem with
config/environments/development.rb config.file_watcher = ActiveSupport::FileUpdateChecker
does that mean with this configuration, it works for you?
Using a file system checker that calls sleep
and then scans the entire file system under the root can work as a default - works everywhere solution. I don't know if the listen gem supports that but I believe it's reasonable implementation if slow, so maybe it's available somewhere.
@djones and anyone else who might have this issue I came across this problem when upgrading to Rails 6 with Docker and @sanemat solution of updating the file_watcher API to use ActiveSupport::FileUpdateChecker
does seem to work for me. From what I can tell the issue seems to be because ActiveSupport::EventsFileUpdateChecker
relies on platform-specific file system events, see docs https://www.rubydoc.info/gems/activesupport/ActiveSupport/EventedFileUpdateChecker
I got error below with linux/amd64 container on arm64 m1 mac
with
then
OK pattern, without listen gem with
then
environments:
repo reproduced: