mirror of
https://github.com/Kozea/WeasyPrint.git
synced 2024-10-05 00:21:15 +03:00
1571528da3
cffi.dlopen should use .so.N symlinks instead of .so to make sure we load ABI compatible version of the library and the same library used by the rest of the system. cffi uses `ctypes.util.find_library` to search for libraries and the docs for `find_library` states that "The exact functionality is system dependent." so different system may expect different names for the same library. To overcome that problem we try to load several names until success among these names exact file name with `.so` suffix eg. `libcairo.so` but .so symlink is not always safe to use. Shared library usually consist of two of three files: - libcairo.so.N.M - N.M exact version number - libcairo.so.N - symlink to library.so.N.M with major ABI version - libcairo.so - symlink to library.so.N When -lcairo flag is used linker search for libcairo.so, but when the programm loaded it loads libcairo.so.N where N is the version that it was linked with. Some downsides of .so usage: - .so may point to the wrong ABI version, e.g. we expect libcairo version 2 but libcairo.so points at libcairo.so.1 - usually .so files are shipped with development packages `-dev` in debian and `-devel` in centos and they are just symlinks to the .so.N files. So it safer to search for .so.N files they will exist even if dev package is not installed. - hard symlink .so -> .so.N not always preserved, eg. if we zip them we get two copies of the library and while the rest of the system will use .so.N file we will load .so files that may lead to crash |
||
---|---|---|
.. | ||
css | ||
formatting_structure | ||
layout | ||
tests | ||
tools | ||
__init__.py | ||
__main__.py | ||
document.py | ||
draw.py | ||
fonts.py | ||
html.py | ||
images.py | ||
logger.py | ||
pdf.py | ||
stacking.py | ||
text.py | ||
urls.py | ||
VERSION |