Page MenuHomePhabricator

MW-Vagrant's docroot should be available from the host machine
Closed, ResolvedPublic

Description

Since the multiwiki features were added, debugging is broken in Vagrant. If you try to use it, you get something like this:

vagrant_xdebug_broken.png (218×607 px, 18 KB)

This is in PHPStorm, maybe other IDEs are more clever, I don't know. But at the very least it is impossible to debug multiwiki issues since the PHP files under /var/www are not accessible from the host machine. Vagrant should put those files under /vagrant/docroot or something and symlink /var/www to that (or copy if symlinking is problematic although the ability to access and alter those files from an IDE would be nice).

Event Timeline

Tgr raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr added a project: MediaWiki-Vagrant.
Tgr subscribed.

Placing the files under /vagrant runs into permission problems due to NFS root squashing. I guess it will have to be done via copying.

gerritbot subscribed.

Change 187874 had a related patch set uploaded (by Gergő Tisza):
Make sure all PHP files are available from the host machine

https://gerrit.wikimedia.org/r/187874

Patch-For-Review

Doesn't work very reliably, some files are not picked up on the first provisioning run. Probably a timing issue.

Setting up the directories for remote debugging is not very user-friendly in PHPStorm. This snippet can be added to .idea/workspace.xml to fix it:

<component name="PhpServers">
  <option name="servers">
    <server host="<host>" name="<host>" port="<port>" use_path_mappings="true">
      <path_mappings>
        <path_mapping local_path="$PROJECT_DIR$/docroot" remote_path="/var/www" />
        <path_mapping local_path="$PROJECT_DIR$" remote_path="/vagrant" />
      </path_mappings>
    </server>
  </option>
</component>

I don't think there is a good way to do that via the git repo or vagrant, though.

In T88149#1005961, @Tgr wrote:

I don't think there is a good way to do that via the git repo or vagrant, though.

Reported that upstream as https://youtrack.jetbrains.com/issue/WI-26425

Change 187874 merged by jenkins-bot:
Make sure all PHP files are available from the host machine

https://gerrit.wikimedia.org/r/187874

Available as /vagrant/srv/docroot.

Tgr claimed this task.

Change 973884 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/vagrant@master] Make composer accessible to the debugger

https://gerrit.wikimedia.org/r/973884

Change 973884 merged by jenkins-bot:

[mediawiki/vagrant@master] Make composer accessible to the debugger

https://gerrit.wikimedia.org/r/973884

Change 984301 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/vagrant@master] Fix ordering for /vagrant/srv/composer

https://gerrit.wikimedia.org/r/984301

Change 984301 merged by jenkins-bot:

[mediawiki/vagrant@master] Fix ordering for /vagrant/srv/composer

https://gerrit.wikimedia.org/r/984301