Dynamically link FriBiDi instead of Raqm#5062
Dynamically link FriBiDi instead of Raqm#5062wiredfool merged 22 commits intopython-pillow:masterfrom
Conversation
|
@nulano is there a way that this can go into the current release? |
setup.py
Outdated
| _dbg("--enable-raqm implies --enable-freetype") | ||
| self.feature.required.add("freetype") | ||
| for x in ("raqm", "fribidi"): | ||
| if getattr(self, f"system_{x}"): |
There was a problem hiding this comment.
This PR is currently set up to default to building vendored libraries. Since this is not fully functional yet (e.g. macOS), I think the best way to get this into the release would be to invert this for now (perhaps using --_vendored-...) and re-evaluate later. Thoughts?
|
I've triggered a run of pillow-wheels on this branch to make sure this actually fixes the issue: https://github.com/nulano/pillow-wheels/actions/runs/457534488 |
|
We're getting seemingly unrelated errors with a bunch of the runs on that pillow-wheels push. It looks like that might be a tiff 4.2.0 issue? |
|
If you're talking about 'RuntimeError: Error setting from dictionary', then that should have been fixed by 6b21a96 |
I changed the repo url to my fork which has a slightly outdated master branch. |
|
Ah, ok. |
|
I think this is (mostly) ready for review, but it will require a second PR in pillow-wheels, and I'm having trouble getting HarfBuzz to compile there. |
|
These wheels are looking good against my earlier repro. (3.8-manylinux1 x86_64) Valgrind is giving a clean report to 10k iterations, where it used to fail quickly. |
If you used the wheels from my link above, I'm pretty sure they are missing HarfBuzz and hence also Raqm:
|
|
ah, not a good test then. |
This comment has been minimized.
This comment has been minimized.
|
I finally got it to compile! (tests failed because it detected Raqm which was not on the expected feature list) |
|
I've tested the wheels and they do appear to have Raqm support, and I can no longer reproduce a crash with 50k iterations. I'll open a PR in pillow-wheels shortly. Edit: python-pillow/pillow-wheels#181 |
|
Looks good to me: All ordinary tests pass, as well as the valgrind run against the test case in #4225. As a comparison, the valgrind case still fails against the shipped 8.1.0 binaries. |
…atibility" This reverts commit b3cfe73.
1b05926 to
aae9411
Compare
|
Does this need to merge before the wheels PR goes in? Is there anything that needs to happen on this? |
Missed the GitHub notification for this... This PR needs to be merged before the wheels PR to make that one pass. Looking over the changes again I noticed and fixed a few small issues, but I don't think there is anything else needed (other than release notes). |
|
OK, Merging. Still need release notes: #5287 |
This is likely to fix issues #3066 and #4225.
Includes Raqm and a FriBiDi shim in
src/thirdparty. Raqm is modified to use the shimand for compatibility with C89(edit: reverted because Raqm is no longer built by default).I've checked that Raqm/FriBiDi/HarfBuzz are being loaded correctly in all of the Windows, Ubuntu, and Docker GHA jobs.
I'm not sure what is missing to get HarfBuzz detected on macOSedit: merging master fixed this somehow.Travis is failing to compile Raqm because it has HarfBuzz 1.0.1 which is too oldedit: disabled dynamic loading by default.Is this the way forward to resolving the Raqm/FreeType crashes? I haven't tried building wheels to see if the issues are actually resolved.
This effectively removes dynamic loading as the default option. It now needs to be explicitly enabled with
--vendor-raqm --vendor-fribidi, e.g. when building wheels. A side effect of these changes is that Windows users now needfribidi.dllinstead oflibraqm.dll.TODO:I intended to add a detailed message for which Raqm version is selected insetup.py.PR in pillow-wheels adding HarfBuzz and enabling dynamic linking.Update config for FriBiDi dynamic linking pillow-wheels#181