Page MenuHomePhabricator

Add mediawiki-vagrant php7.2 xdebug support
Closed, ResolvedPublic

Description

Looks like Debian doesn't have a package for php7.2-xdebug so we'll need to install it via PECL for the time being.

Event Timeline

jgleeson created this task.Apr 8 2019, 2:48 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 8 2019, 2:48 PM
jgleeson renamed this task from Add php7.2 xdebug support to Add mediawiki-vagrant php7.2 xdebug support.Apr 8 2019, 2:49 PM

Change 502495 had a related patch set uploaded (by Jgleeson; owner: Jgleeson):
[mediawiki/vagrant@master] WIP: Add support for xdebug in php7.2

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

Change 502495 merged by jenkins-bot:
[mediawiki/vagrant@master] Add support for xdebug on PHP 7.2

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

The change above results in the message Cannot load Xdebug - it was already loaded whenever I run a maintenance script in vagrant. Xdebug was previously added to MediaWiki vagrant in T212045: Vagrant has Xdebug no longer enabled, preventing debugging and code coverage generation, and it appears both are actually loaded.

jgleeson added a comment.EditedApr 24 2019, 10:04 AM

Oh shoot, sorry about that!

I don't see xdebug available via apt for php 7.2 on my mw-vagrant install (before this patch), only xdebug 2.5.0 for the secondary php7.0 install.

I'll revert out the commit and try to work out why we're not seeing the package being discussed in https://phabricator.wikimedia.org/T212045

Change 506121 had a related patch set uploaded (by Jgleeson; owner: Jgleeson):
[mediawiki/vagrant@master] Revert "Add support for xdebug on PHP 7.2"

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

Change 506121 merged by jenkins-bot:
[mediawiki/vagrant@master] Revert "Add support for xdebug on PHP 7.2"

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

bd808 added a subscriber: bd808.Apr 25 2019, 3:46 AM

The change above results in the message Cannot load Xdebug - it was already loaded whenever I run a maintenance script in vagrant. Xdebug was previously added to MediaWiki vagrant in T212045: Vagrant has Xdebug no longer enabled, preventing debugging and code coverage generation, and it appears both are actually loaded.

Was this problem seen on a clean vm instance or on an instance that had been built (or updated) with the old thirdparty/php72 repo? I'm going to guess the latter.

We generally do not add Puppet code in MediaWiki-Vagrant to remove old components as this is difficult and error prone. Issues such as the collision of old and new packages are generally left for the MediaWiki-Vagrant user to resolve manually inside an existing vm instance or more ideally by destroying the corrupt vm and building a new one. If @jgleeson's patch works as expected on a clean MediaWiki-Vagrant instance the best way forward may be to create some documentation on how to manually clean up a vm with the older apt package installed and announce that on wikitech-l to let others know how to resolve the issue if they are not willing or able to rebuild their vm from scratch.

It was the latter, I updated because of an unrelated reason (needed rMWVAe7f3fd), and after provisioning, I noticed the message.

The thing, is xdebug, and remote debugging worked just fine (as I've used it multiple times) before the patch was merged, so to me, the whole patch seems unnecessary in the first place, that's why I filed T212045 in the first place. If the patch here is a better solution, then sure, by all means, use that instead.

bd808 added a comment.Apr 26 2019, 2:28 AM

The thing, is xdebug, and remote debugging worked just fine (as I've used it multiple times) before the patch was merged, so to me, the whole patch seems unnecessary in the first place, that's why I filed T212045 in the first place. If the patch here is a better solution, then sure, by all means, use that instead.

Between the time that T212045: Vagrant has Xdebug no longer enabled, preventing debugging and code coverage generation was closed and now MediaWiki-Vagrant followed production's move from using the thirdparty/php72 repo to T216712: Switch PHP 7.2 packages to an internal component. This new repo does not have the php-xdebug package that was added to the prior repo in T212757: Please import php-xdebug to apt.wm.o thirdparty/php72.

The "proper" fix is probably to ask for the equivalent of T212757: Please import php-xdebug to apt.wm.o thirdparty/php72 done again in the new repo by an SRE rather than forcing every VM to compile the PECL package manually.

Ah, I incorrectly assumed, that because T216712 wasn't marked as resolved yet, that that hadn't happened yet. I've filed T221923 for that. However, as SRE is off-site this week according to wikitech.org, temporarily reverting https://gerrit.wikimedia.org/r/506121 might help those currently without xdebug.

Looks like we now have a package in apt.wikimedia.org for xdebug for php7.2 (T221923) and no longer need to build it as part of the provisioning steps.

jgleeson closed this task as Resolved.Apr 26 2019, 12:16 PM