Talk:Wikidiff2

From mediawiki.org
Latest comment: 1 year ago by Alex Mashin in topic Alpine

Also inline (one column) option now[edit]

Since [1]. Apparently it's the default for the mobile version of Wikimedia projects now: gerrit:106629. --Nemo 07:14, 21 January 2014 (UTC)Reply

Algorithm?[edit]

Is the algo explicitly described somewhere? mentions Dairiki who says to have borrowed from Ned Konz, [2] and GNU diffutils-2.7.

Some people like git diff, which according to [3] uses [4] which is based on Myers. --Nemo 11:46, 14 September 2014 (UTC)Reply

"wikidiff2: command not found" errors[edit]

On an Ubuntu 14.10 server after manually updating from MW 1.19 to 1.23.8, all diff pages reported "No difference," even when a difference was clearly apparent. Diffs worked as expected under 1.19. Apache's logs threw `/bin/bash: wikidiff2: command not found` when loading the diff page. This error appears to be unrelated to the wikidiff2 extension, and setting $wgExternalDiffEngine in LocalSettings.php (which was not previously set) to wikidiff3 had no effect; instead, removing an installed Ubuntu package named `php-wikidiff2` from the server resolved the problem, and diffs worked as expected. A google search unearthed a wmflabs IRC log from 2013, which was the only resource I found when searching for this error message. Users spectie and marktraceur reported the resolution. --75.175.21.212 19:21, 21 December 2014 (UTC)Reply


"php-wikidiff2" vs "wikidiff2" in php.ini[edit]

Just pointing out that in my Ubuntu default installation wikidiff2 is installed with the name wikidiff2.so, not php-wikidiff2. This means that "extension = php_wikidiff2.so" should be "extension = wikidiff2.so" The error that indicates the problem is:

sh: 1: wikidiff2: not found

and on apache restart:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/php_wikidiff2.so' - /usr/lib/php5/20121212/php_wikidiff2.so: cannot open shared object file: No such file or directory in Unknown on line 0

Optimalbpm (talk) 09:39, 22 March 2015 (UTC)Reply

Bug in Debian package (and downstream, such as Ubuntu)[edit]

In the debian branch, Wikidiff2 has a bug that was supposed to be fixed on 2016-08-10 in version 1.4.1. The commit did not fix the issue, though, and it is the latest commit in this branch. Debian branch is supposed to hold the Debian-specific packaging files.

In debian/php-wikidiff2.postinst,

 [ "$1" = "configure "] && php5enmod -s ALL wikidiff2

was changed to

 [ "$1" = "configure " ] && php5enmod -s ALL wikidiff2

which prevents the test command ([) from failing due to missing last argument ]. But the php5enmod is still never run, because the first argument to this postinst script ($1) is compared to incorrect value -- it should not contain the trailing space. Ideally, quotes should be omitted in this case…

To work around this bug, you should execute

 php5enmod -s ALL wikidiff2

as root yourself and restart your server. It is the only thing that the package failed to perform.

-- Palec90 (talk) 13:56, 7 November 2016 (UTC)Reply


By the way, this causes the sh: 1: wikidiff2: not found in error log. It comes from wfShellExec in includes/diff/DifferenceEngine.php. Guess the implementation should handle the error better than letting the shell command execute and fail, with a shell-specific error message. --Palec90 (talk) 14:43, 7 November 2016 (UTC)Reply
Thanks for this great report. I think the most effective way to attract attention to maintainers is to report it on phabricator. The workaround would still be useful until it's fixed. --Ciencia Al Poder (talk) 16:44, 7 November 2016 (UTC)Reply
Are you using the package from the official Debian sid repos? Or from apt.wikimedia.org? The commit you linked is for the Wikimedia package, not the official Debian one. In any case, the official Debian package hasn't ever enabled the module upon installation AFAIK - if you want that functionality, it would be appreciated if you could file a bug for it. Legoktm (talk) 01:44, 8 November 2016 (UTC)Reply

Segmentation fault[edit]

I'm trying to use wikidiff2 with PHP 7.0.22-0ubuntu0.16.04.1. The installed package is php-wikidiff2 1.2+git03ea59f-1ubuntu3. Whenever I enable wikidiff2 any attempt at a diff fails with segmentation faults reported in the Apache error log. Any ideas as to how I can fix this? --Prh47bridge (talk) 10:49, 23 October 2017 (UTC)Reply

Should have said - I'm running MediaWiki 1.29.1 --Prh47bridge (talk) 10:50, 23 October 2017 (UTC)Reply
wikidiff2 is already at version 1.5.1 so this may be due to the outdated version that ships with Ubuntu. When looking at the the last official release I see that it was done in October last year for version 1.4.1 which is also outdated in the meantime. I'd think that somehow running the latest version is much better. Perhaps @Legoktm: has more insight into wikidiff2. Cheers --[[kgh]] (talk) 11:00, 23 October 2017 (UTC)Reply
Thanks for the quick response. I've downloaded and built 1.4.1. It now seems to be working fine. --Prh47bridge (talk) 12:37, 23 October 2017 (UTC)Reply
Great that it now works out for you. Still wondering if a 1.5.1 tarball will be around. Cheers --[[kgh]] (talk) 13:49, 23 October 2017 (UTC)Reply
Yes, I was just waiting for 1.5.1 to be successfully deployed to Wikimedia sites to make sure there were no regressions before recommending others start using it :) Legoktm (talk) 00:09, 24 October 2017 (UTC)Reply
Thanks for reporting the segfault problem, I'm looking into it. Legoktm (talk) 05:37, 24 October 2017 (UTC)Reply
I forgot to follow up, 1.5.1 tarballs have been published. Also, you can use my PPA to install wikidiff2 for xenial that I have tested to work instead of needing to compile it manuallly. Legoktm (talk) 06:21, 12 November 2017 (UTC)Reply

Thank you, I used the engine outside of MediaWiki[edit]

I used Wikidiff2 to improve the display of french law-making (the diffs between the steps in the parlement) [5] and I'm now building a generic git viewer using Wikidiff2 for the diffs [6]. So, just passing by to say thank you and to show you what I've used the engine for. Dam-io (talk) 16:15, 1 April 2020 (UTC)Reply

Windows[edit]

hi!

since there is no dll for windows for download available. could someone be so nice and write the steps for compiling on windows? I guess they are not the same as for linux (configure/make)? Berot3 (talk) 16:04, 12 May 2021 (UTC)Reply

GNU diff[edit]

Under Manual:Installation_requirements#Other_software I found GNU diff3 utility.

Just wondering, why isn't wikidiff2 listed there as well?

Also: how does it compare to each other? I guess I can not use them both at the same time? Berot3 (talk) 17:03, 12 May 2021 (UTC)Reply

Alpine[edit]

Has abybody managed to install or build wikidiff2 under Alpine Linux? Alexander Mashin talk 13:06, 20 February 2023 (UTC)Reply

The key to success was to install libthai and libthai-dev with: apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing libthai libthai-dev, since libthai is in testing repository. Alexander Mashin talk 13:21, 20 February 2023 (UTC)Reply