-
-
Notifications
You must be signed in to change notification settings - Fork 711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests do not pass with Cairo development snapshots #1291
Comments
Hello! Tests don’t pass probably because you have Cairo 1.17.x. Tests only pass with Cairo 1.16.x. |
🤦 It should probably be the business of a project which depends extensively on Cairo to keep itself up to date with Cairo. |
Please, be kind ❤️.
Actually, the Having tests passing with both Cairo 1.16.x (that’s still used on many distributions) and 1.17.x (that were marked as unstable when they were released) requires a lot of work. As Cairo suffers from technical and organizational problems (see Cairo’s mailing list), we decided to write our own PDF generator. It takes some time, that’s why there’s no release yet without Cairo. You can read more about that on #1232 (the issue is pinned, you can’t miss it). |
Thank you for confirming this is a bug in WeasyPrint.
That's just an incredibly, incredibly weak argument. One person raises histrionics claiming that there's no one in charge, less than 24 hours later the one in charge pops up and says "hi, of course I can make a release" but also begins a discussion about passing on the torch to a new release manager. I find it very difficult, based on that link, to even begin to understand why one might think cairo is unmaintained. But hey, that's all completely irrelevant. Dropping a complex binary dependency is not necessarily a bad thing, if you think you don't need it. Just don't blame it on "they have organizational problems". :) ... Might I recommend making sure unittests pass on your latest release, even if you've rewritten the code in unreleased master? It's not exactly hard to hotfix this, either -- Do you expect weasyprint to work on cairo 1.17 and it's just a matter of unittests not being updated? It should not take more effort to if/else the tests based on cairo version than it would to go straight to the new version only. I would generally consider it advisable to test your software against the latest release of critical dependencies just for future proofing and to catch problems early, and you had several years to do it -- so it's a bit disappointing to not see this done, regardless of reasons. |
No problem!
We don’t want to use Cairo anymore for many reasons. I wrote that "Cairo suffers from technical and organizational problems" and gave an example, that’s all. I didn’t say that the organizational problems were the only reasons. If you want to technical reasons (not the only ones):
And I definitely think and say that they have organizational problems.
I really love the Cairo team, I really love the Cairo library, I have huge respect for what they do. This library is incredible. It’s just that it’s not adapted to WeasyPrint anymore, in our opinion. For technical reasons, for organizational reasons.
Version 53 of WeasyPrint will not use Cairo anymore. We may want to spend time on the 52.x versions in the future, to make it compatible with new stable versions of Cairo, but that’s not sure at all. Tests currently don’t pass because some things are broken. Adding xfails won’t fix WeasyPrint with Cairo 1.17.x versions, that’s not a way to make "weasyprint to work on cairo 1.17" (unfortunately 😄).
Cairo 1.17.4 is not a Cairo release. It’s just a "development snapshot". WeasyPrint 52.x is tested with "the latest release of critical dependencies", which is 1.16.0 for Cairo. We prefer to spend our time on WeasyPrint’s next version, instead of supporting next versions of Cairo. We took some time to write a PDF generator allowing us to fix many bugs caused by Cairo and to add many features. You may agree, you may disagree. You may even be disappointed. I was disappointed too. To see that ArchLinux and Homebrew, for example, decided to include a Cairo snapshot just as if it was a stable release. But, well, they do what they want after all, they don’t owe me anything 😉. It’s not Arch’s fault. It’s not Cairo’s fault. It’s just hard to maintain free software and people often do their best. We’ll be happy and grateful to merge a pull request fixing WeasyPrint with Cairo 1.17.4 in the 52.x branch. It’s just not our priority right now. |
Just wanted to mention that we have the same problem in Fedora and I started to look into this issue but did not produce any meaningful artefact due to my lack of free time. I'll try to come up with a patch before the Fedora 34 cutoff date (otherwise we'd have to remove WeasyPrint). If anyone else starts to work on this issue please leave a message in this ticket (or ping me directly) so to avoid duplicate work. My idea would be to build a minimal reproduction test case in Python (via cairocffi). Maybe that is already enough and we can figure out what needs to be changed. Otherwise I would try to create a minimal C program so the cairo developers could help out. |
Btw: I did start to build a minimal reproduction example (though it seems like there is still a long road ahead of me). Current state is published at https://github.com/FelixSchwarz/cairo117-repro Also I bisected the problem back to cairo commit ea932921:
Reverting that commit on top of the current cairo master fixes the WeasyPrint problem for me. |
@FelixSchwarz Thanks a lot for your hard work on this. Could you try to use the By the way, Cairo 1.17.4 also suffers from a bug that randomly breaks fonts embedded in PDF documents. The patch used to solve the issue has to be applied to your version of Cairo, or WeasyPrint will be hardly usable. |
@liZe Thanks for the pointer. I'll try to get the patch included in Fedora's cairo. Btw: Any estimate when the pydyf version will be ready? I'm trying to plan how much time I should spend beating cairo into shape... (Feel free to send me a direct email if you don't want to communicate this publicly yet) |
sorry for the noise but I just wanted to mention that Fedora 34 will include the patch for cairo issue 449 so pinging us (me) about any underlying library issues is highly appreciated: https://bugzilla.redhat.com/show_bug.cgi?id=1939399 |
We hope to release a beta version in April, and to release a stable version when all the reported bugs are fixed (between June and September?) |
I have had the same patch backported to Arch Linux too: |
It’s now released 🚀! |
I'm trying to get an Arch Linux PKGBUILD to build weasyprint. The unittests won't pass though, with the following error:
I do have the dejavu fonts installed, as well as gdk-pixbuf2, pango, and all the python module dependencies.
PKGBUILD
The text was updated successfully, but these errors were encountered: