Page MenuHomePhabricator

Allow default value for PATH variable in wfShellExec
Open, Needs TriagePublic

Description

While running MediaWiki 1.26 on a Debian Jessie server (with PHP 5.6) with the mediawiki-math-texvc package, I have been hit by T10625#135553. The lack of a PATH variable caused texvc to fail, and currently there seems to be no way of fixing this without either hacking the Math extension with the given patch, adding putenv calls in LocalSettings.php (and I don't know if this works for me, haven't tested that yet - but even if it does, I believe using plain PHP functions in LocalSettings.php (with the exception of really important stuff such as the MEDIAWIKI define check) should be avoided.

Can we assign a default value to the PATH variable somehow in wfShellExec? Such as adding a default $wgPathEnvironment variable, which can be overriden?

Related Objects

Event Timeline

Note this. So no "mediawiki-math-texvc package" for 8.5+

@Kghbln yes, I am aware of that, and I spoke to @MoritzMuehlenhoff, and he said that in hindsight the mediawiki-math-texvc should never have been deleted. Perhaps it will be packaged again - but I'm not sure if Debian's policies allow that, since it would mean that it has to be introduced in the jessie (stable) suite again. Otherwise we'd still need to wait until Debian 9 has been released.

Perhaps it will be packaged again

This will be nice since it offered an easy setup for Math support and was working reliably. Switching to Mathoid may be painful. Last time I checked the instruction were referring to the situation in 2010 or so. The usual disaster. Not even talking about people on shared hosting.

@Legoktm is the new mediawiki maintainer in Debian, for Debian 9 it should be possible to easily reintroduce mediawiki-math-texvc (possibly via a separate source package from mediawiki, since texvc is built from architecture-specific C code, while the mediawiki package is architecture-agnostic).

In addition I've contacted the Debian release managers on the possibilty of reintroducing mediawiki-math-texvc in jessie 8.6 and will keep this bug updated. mediawiki-math was removed along with mediawiki since mediawiki-extension-math depended on mediawiki and the Debian archive scripts don't allow unmet dependencies. It's unfortunately that the usecase of mediawiki-math-texvc along with a custom mediawiki installation was missed :-/

As an interim solution there's BTW the possibilty to fetch the old binary from http://snapshot.debian.org/package/mediawiki-math/

@MoritzMuehlenhoff Thank you for your insight and engagement. Much appreciated!

The bug for the reintroduction of texvc can be found here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=830780
Once it has been accepted into Debian testing, it can be uploaded to jessie-backports.

So...will re-introducing the package for jessie fix this issue? Or do we need to make changes in MW? I don't understand it fully to be honest, and the linked bug is marked as declined...

Step 1 seems to be re-introducing the texvc package (whose deletion actually was unrelated when I created the issue, it just made this task more or less invalid, because the issue was kinda gone - since nobody (except users who still have that package installed) would be hit by it anymore). That is a blocker for this task.

Afterwards we can actually do something with this task. I am hit by T10625#135553, and changing the PATH variable fixes that. It is preferred that either the Math extension or MW core gets a fix for this. For Math it would be something that sets a PATH (which should be configurable by the user), although I think that MW core might make more sense (so a PATH for every wfShellExec call can be configured).

texvc has been re-accepted into Debian and will ship in the stretch release. Next step will be getting it into jessie-backports - I've started working on that now.

@Kghbln : texvc is now available in jessie-backports.

I've posted builds for trusty and xenial on my test ppa: https://launchpad.net/~legoktm/+archive/ubuntu/legoktm-test/ if you want to test it on those platforms. Otherwise I'll test it myself and publish it to the main PPA once I'm back from vacation (first week of January-ish).

So, time to fix the second part of this bug now?