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
Fix#1027.
Footers of split tables have a wrong position: they keep their position before
splitting the table. This commit is an improvement (it doesn’t crash anymore,
data are OK on each page) but it’s far from perfect.
We also have to take care of absolute and fixed elements in footers. It’s
probably already broken (see related #138), so…
TODOs have been added where things have to be improved.
__bool__()/__nonzero__() is deprecated and raises a FutureWarning. This warning
is usually not visible with CPython. However it is highly irritating with
pypy3 (v7.1.1).
Setuptools doesn’t automatically find packages with no __init__.py file. We
have to manually list packages to avoid this limitation, for example for
ReadTheDocs installations.
At the end of a linebox layout, we have to check that the new linebox has the
same position as the originally calculated one. If the position is different,
it means that a floating element needs to push the linebox to a lower position.
With ltr lines, the box horizontal position is calculated related to the left
border of the box. It’s different with rtl lines, because the left border has
to be translated to the left each time the linebox width changes. We thus need
to rely on the right border for rtl lines.
As the rtl lineboxes are now right aligned (just like any other block-level
box), we don’t have to take care about direction when calculating offset.
Text is now translated when text-align is different from start. It’s translated
to the right with ltr and to the left with rtl.
Using low-level functions forces us to handle low-level file descriptors and
encodings, while we could safely rely on Python for that.
Related to #1074.