WordPress.org

Make WordPress Core

Opened 10 months ago

Closed 2 months ago

#44271 closed defect (bug) (invalid)

grunt watch doesn't detect changes when ran from inside guest machine using VVV

Reported by: mnelson4 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description

I created an issue inside VVV's repo too: https://github.com/Varying-Vagrant-Vagrants/VVV/issues/1531. Creating an issue here in case this issue can be fixed from the WP side. If not, feel free to invalidate this, it will probably still be good to have a record of this IMO.

Expected Behavior

Since WordPress' new build process was introduced (see https://make.wordpress.org/core/2018/05/16/preparing-wordpress-for-a-javascript-future-part-1-build-step-and-folder-reorganization/) we should be running grunt watch which should copy the changes made from the src directory into the build one.

Current Behavior

However, in VVV, when you make a change to a file (from your host machine or inside the VM) that's in a shared directory, grunt doesn't notice the change.
Possible Solution

This is probably because of https://www.virtualbox.org/ticket/10660 (so it's a Virtual box issue). BUt I'm reporting here in case someone else has this issue and is looking for a fix, and it's possible we might find some workaround for VVV.

Steps to Reproduce

Do git clone git://develop.git.wordpress.org/ from inside VVV's www shared folder
from inside there, run npm install && grunt build. Then grunt watch. Wait until it says it's "Waiting..."
Edit a file from inside src
Notice that the grunt task doesn't acknowledge that change, nor update the corresponding file in build

Context

I've been using the same WP develop checkout for both developing a few plugins, and for the occasional core contribution. So for developing plugins I will probably put my wp-content folder outside of the normal WP src folder, and use define( 'WP_CONTENT_DIR', dirname( dirname(FILE) ) . '/content' ); define( 'WP_CONTENT_URL', 'http://dev.local/content' );) so that I don't need to wait for grunt watch to copy all my changes from src to build everytime. But I'm currently a bit stuck for WP core contributions.

Your Environment

VVV version: 2.1.0
VVV Git Branch: master (commit 710f085)
Vagrant version: 2.0.2
VM Provider name: Virtual Box
VM Provider version: 5.1.32
Operating System and version: Windows 7

Change History (4)

This ticket was mentioned in Slack in #core by mnelson4. View the logs.


10 months ago

#2 @mnelson4
10 months ago

apparently grunt watch is implemented using grunt-contrib-watch. We have a similar system in place for our plugin but it uses webpack --watch --watch-poll, which is able to overcome this issue somehow

#4 @pento
2 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version trunk deleted

Per the VVV issue discussion, closing this as a problem with Vagrant.

Note: See TracTickets for help on using tickets.