Skip to content

[WSL2] File changes made by Windows apps on Windows filesystem don't trigger notifications for Linux apps #4739

@SteveSandersonMS

Description

@SteveSandersonMS

WSL2 is really close to being a perfect runtime environment for server apps being developed in Windows. Great job! One missing feature however is breaking a core part of the developer flow.

For sources stored on the Windows filesystem, any changes made by Windows applications such as Visual Studio do not trigger any file change notifications as far as Linux apps are concerned. This means that all "live rebuild"-type tools don't work (examples: webpack --watch, jekyll --interactive, and Tilt.dev) when running under WSL2. This unfortunately renders many modern dev workflows unviable.

Notes:

Bug report template

  • Your Windows build number: 10.0.19033.1

  • What you're doing and what's happening:

    This applies to all tools that listen for file change notifications, but as an example take webpack. Repro steps:

    • In your Windows filesystem, create an empty directory (example: c:\repro), and then add these three files to it
    • In a WSL2 Ubuntu 18.04 environment, install Node and NPM: sudo apt-get install nodejs npm
    • Still in WSL2, go into the directory from earlier: cd /mnt/c/repro
    • Restore NPM dependencies: npm i
    • Run Webpack in watch mode: npm run build:watch. Wait a few seconds until it completes the first build. It will now be waiting for further changes to your source files.
    • In a Windows application (e.g., Notepad or Visual Studio), open c:\repro\index.js and save some change to it. For example, change 'Hello, world' to 'Hello, world 2'.
  • What's wrong / what should be happening instead:

    Expected behavior: Webpack should see the change and rebuild. That is, you'll see it log information about another build, and the output in dist/bundle.js will be updated.

    Actual behavior: Webpack doesn't respond at all, because there's no file change notification.

Finally I understand that the fix for this is likely to be "add file watch capabilities to the Plan9 server", and you may feel this is already being tracked by #4064. However #4064 describes a more obscure symptom of this missing feature and makes it sound like an intermittent issue. What I'm reporting here is not intermittent at all, and is a pretty mainstream scenario (using tools like webpack --watch). Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurewsl2Issue/feature applies to WSL 2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions