WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Filesystem watchers like libinotify do not work

Open mablae opened this issue 10 years ago • 163 comments

The whole /proc/sys/fs structure is missing, too.

inotitywait does not get triggered by filesystem changes.

mablae avatar Apr 16 '16 21:04 mablae

Thanks for reporting the issue.

Currently, only portions of procfs are implemented and there is limited inotify support. To get this on our priority list can you add it to our [UserVoice](https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/category/161892-bash page) page? Thanks again for trying out WSL!

stehufntdev avatar Apr 18 '16 14:04 stehufntdev

I just added at UserVoice request for filesystem watchers & inotify. https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13469097-support-for-filesystem-watchers-like-inotify

patryk9200 avatar Apr 18 '16 16:04 patryk9200

@patryk9200 Thanks!

mablae avatar Apr 18 '16 17:04 mablae

All of the node.js watch functions that I've tried fail on EPERM. I've ensured that all files and directories that it's trying to access have the proper ownership group and user. I even tried running watch tasks as the root user, and I receive the same eperm issue. I've also made sure that all of the files are listed inside the linux subsystem, and that I'm not trying to watch files mounted to /mnt/c/

JSMike avatar Jun 01 '16 16:06 JSMike

JSMike: It does not work. This is why we opened this issue :smile:

mablae avatar Jun 01 '16 18:06 mablae

yes, I was just trying to add detail

JSMike avatar Jun 01 '16 18:06 JSMike

Thanks for the feedback. Inotify will not be fully supported in the Anniversary update, but we are tracking the work for future insider builds. If you haven't already, please vote on the user voice page for inotify (https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/13469097-support-for-filesystem-watchers-like-inotify).

stehufntdev avatar Jul 05 '16 14:07 stehufntdev

I'm in the same boat #697 .. I have to go back to CygWin until we can see this resolved. I am very excited about this in Windows though. I spent a good day trying to get our dev kit working, and from what I can tell, the build is very solid. But yes, I also fell into missing proc/sys/net problems with mongo too so we will have to come back once these features are enabled.

alanosman avatar Jul 28 '16 00:07 alanosman

@SRGOM -- I don't know that there's automated telemetry, but users can vote on issues here:

https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/category/161892-bash

So Microsoft does have some information about both which features people want to use and how much they care about them.

On that note -- have you voted for this issue there? It's relatively high on the list.

aseering avatar Aug 01 '16 11:08 aseering

Just posting here to show how much I would love to see this feature implemented

ghost avatar Aug 03 '16 22:08 ghost

@meffect if you haven't already, you should throw three votes at it on the UserVoice page linked above. It has gotten a lot of traction lately, but hasn't yet been tagged by the MS team.

jwsloan avatar Aug 04 '16 12:08 jwsloan

how about how to work around the issue in the meantime??? for example what config settings etc, need to be used for a basic rails 5x install?

catmando avatar Aug 04 '16 15:08 catmando

I generated my app with --skip-spring --skip-listen. Then when I run guard I use guard -p to force polling mode. I thought about trying to get spork running instead of spring, but I haven't done that yet. Guard without Spring does make TDD a slow and painful process, though. So I love seeing that UserVoice page getting more votes.

jwsloan avatar Aug 04 '16 15:08 jwsloan

Thanks @jwsloan

If you have already generated a rails app, here is what you have to do to fix:

  1. comment out this gems listen, spring, and spring-watcher-listen in the Gemfile:
  #gem 'listen', '~> 3.0.5'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  #gem 'spring'
  #gem 'spring-watcher-listen', '~> 2.0.0'

I am not sure you have to comment out spring / spring-watcher-listen, but that works for me...

Then in the development.rb comment out this line:

  #config.file_watcher = ActiveSupport::EventedFileUpdateChecker

and of course bundle install...

catmando avatar Aug 04 '16 15:08 catmando

Good call on the file_watcher config, @catmando. I forgot about that part. I had to do that as well.

jwsloan avatar Aug 04 '16 15:08 jwsloan

@jwsloan Yep I gave it 3 votes. Imo, it looks more important than some of the ones above it so hopefully microsoft will tag it soon

ghost avatar Aug 04 '16 16:08 ghost

My currently blocking issue is writing an web application. typescript -watch and gulp -watch no workie. My way around it is to use node/npm windows binaries for gulp and typescript. the work around is ok, but not ideal for me because I use conemu to open 4 bash terminals inside a single window. i dont really like having to open a second window to call windows binaries for various reasons, mainly extra screen real estate needed. Also i'd much prefer to not have those windows binaries installed at all on my machine and just have the linux ones.

But ya there seem to be many other issues out there where you cant really work around them

ghost avatar Aug 04 '16 16:08 ghost

Personally the workaround I used with a rails 5 application was to modify the file_watcher config in development.rb so that it can be disabled with an environment variable.

config.file_watcher = ActiveSupport::EventedFileUpdateChecker unless ENV['NO_INOTIFY']

Then set the the NO_INOTIFY environment variable in my .zshrc. That way one can still easily collaborate with people not using WSL, or just dev on other machines without Gemfile mess :)

I didn't need to do anything with the Gemfile at all here, it seemed to fall back to polling nicely.

bluefantail avatar Aug 05 '16 00:08 bluefantail

Thanks for the info, @bluefantail. Are you using Spring with that setup?

jwsloan avatar Aug 05 '16 11:08 jwsloan

Yea I am, I initially thought that would be an issue as well and tried re-bundling without it (unsuccessfully). Disabling the file_watcher seemed to do the job, without the need for disabling spring at all. I'm newish to rails, but I can only presume if spring is an issue, the config also disables the spring-listen file watchers as well, or something like that. This is the Gemfile in question https://github.com/bluefantail/bathtub/blob/master/Gemfile

bluefantail avatar Aug 06 '16 07:08 bluefantail