Several librsvg issues are not fixed in 2.44.10 (Debian Buster), but are in later versions.
Debian Bullseye (testing) ships a more recent version: https://packages.debian.org/bullseye/librsvg2-bin (as of October 2023, that 2.50.3)
AntiCompositeNumber | |
Oct 14 2020, 9:41 PM |
Restricted File | |
May 21 2023, 8:34 AM |
F37026547: 1.png | |
May 21 2023, 8:30 AM |
F37026542: 3.png | |
May 21 2023, 8:30 AM |
F34459692: result-zh_hant.png | |
May 19 2021, 8:00 AM |
F34459679: result-sr_ec.png | |
May 19 2021, 8:00 AM |
F34459691: result-zh-hant.png | |
May 19 2021, 8:00 AM |
F34459687: result-zh-cn.png | |
May 19 2021, 8:00 AM |
F34459681: result-sr_el.png | |
May 19 2021, 8:00 AM |
Several librsvg issues are not fixed in 2.44.10 (Debian Buster), but are in later versions.
Debian Bullseye (testing) ships a more recent version: https://packages.debian.org/bullseye/librsvg2-bin (as of October 2023, that 2.50.3)
I think if you wrote a build script for that, and tested it on a stretch container, I would support deploying it.
I feel the frustration, but it is no longer just a matter of installing the latest librsvg. The latest version will choke if hyphenated langtags (e.g., sr-latn, zh-hant, ku-arab) are passed to librsvg via the $LANG environment variable.
MediaWiki and Thumbor code needs to be updated.
The PHP $lang langtag needs to be passed in via the --accept-language command line argument. See
The code changes are less than half a page. One of the phabricator issues points to the MW and Thumbor sources; I do not see it above.
I do not know PHP or Python, but here are the changes needed to wiki configuration, SVGHandler.php, and Thumbor's svg.py.
They are breaking changes. They need the Rust version of librsvg/rsvg-convert. If used with the old version of librsvg, I expect the new command line arg would cause an exception.
MediaWiki could be made compatible by having rsvg and rsvglang entries and testing for a "$lang" substring in the conversion string.
Thumbor is hardwired, so making it compatible with both versions would be more complicated. However, it would be good to allow Thumbor to use both rsvg-convert or resvg.
I grepped for rsvg in exec.log and found nothing, going back to May, so it looks like T260504 is sufficiently complete that we don't have to upgrade librsvg on the appservers or update SvgHandler::rasterize(). An update to SvgHandler::rasterize() could be done as a courtesy to non-WMF users but it does not block this task.
If we install the new version of librsvg into a custom prefix, say /opt/librsvg-2.54, so that we can have both versions of librsvg installed, then we can switch the version in the Thumbor configuration. That would allow us to decouple the librsvg deployment from Thumbor 7 and the OS upgrade, reducing risks.
Changing one line of code in svg.py on the existing Thumbor servers is an annoyingly complex task. We could instead have a shell script wrapper, installed by Puppet, along the lines of
#!/bin/sh LANG=en_US.UTF-8 /opt/librsvg-2.54/rsvg-convert --accept-language="$LANG" "$@"
We can change the binary that Thumbor uses in puppet. /etc/thumbor.d/40-wikimedia.conf comes from the package but it can be safely replaced by Puppet.
Beyond rust version, the dependency issue is mainly pango. Buster has 1.42.3 while librsvg wants 1.46. This bar was raised by two commits upstream:
Built it on buster with patches to deal with pango version; it works well enough. See https://gist.github.com/Artoria2e5/458f3dfcf5aa68272648c1dc21c039ae for how.
Test images with the haphazard build:
It would look less deformed with hinting disabled, but for the sake of small text I want to keep it on. Not a wise choice given that upstream has it off, I know.
Wow I am actually impressed this thing uploads. Run this binary at your own risk.
{F37026565}
So uh @tstarling, what about the promise of trying to deploy a build script? I've got all the steps laid out...
Following remark of Aklapper in T97233, raising priority to high. Many users are stumbling across that regression bug.
The switch to librsvg 2.44.10 broke many files. Some files have been fixed by hacking LC_ALL, but that is not a long-term fix. And that fix will be less than optimal when more recent librsvg versions are used.
Even using Bullseye only loads librsvg 2.50.3; Bookworm has 2.54.5.
WMF should be loading more recent versions of librsvg. When WMF was running the C version on an ancient Debian, it was loading a recent C version of librsvg.
Yet another victim of the T97233 tspan regression:
WMF should install a recent version of librsvg.
We are using Thumbor on bullseye everywhere which means that SVGs will be rendered by 2.50.3. Keeping this task open for tracking issues for the moment.
Suggested wording for tech news:
The software used to create previews of SVG files as been updated to a new version, fixing many longstanding bugs in SVG rendering.