-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Description
Overview
At the moment, skia-python includes several dynamic library dependencies in its manylinux wheel:
libbz2-a273e504.so.1.0.6
libfontconfig-42c558d2.so.1.11.1
libfreetype-c0e61f0c.so.6.14.0
libpng15-ce838cd1.so.15.13.0
libuuid-f64cda11.so.1.3.0
This is convenient since it reduces the number of system packages that a user needs to install, but it has some serious drawbacks:
- These libraries are significantly out of date compared to versions on modern systems (see table below), they likely contain bugs, vulnerabilities (see Vulnerable shared libraries might make skia-python vulnerable. Can you help upgrade to patch versions? #175), or compatibility issues with Skia.
- Skia explicitly recommends against static linking or bundling dynamic libraries for production builds.
- This can cause issues with libraries like
libfontconfigthat depend on configuration files found in the system. For example, modern Debian installs a config file at/usr/share/fontconfig/conf.avail/05-reset-dirs-sample.confthat is incompatible with the older version oflibfontconfigbundled withskia-python, causing a warning:
Fontconfig warning: "/usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf", line 6: unknown element "reset-dirs"
How these get bundled
The present build system for skia-python causes this through two location. First, Skia is told not to use system packages when being built:
skia-python/scripts/build_Linux.sh
Lines 71 to 76 in db7d7fc
| skia_use_system_libjpeg_turbo=false | |
| skia_use_system_libwebp=false | |
| skia_use_system_libpng=false | |
| skia_use_system_icu=false | |
| skia_use_system_harfbuzz=false | |
| skia_use_system_freetype2=false |
Second, cibuildwheel will run auditwheel on any manylinux wheel. This where these dependencies get grafted into the wheel.
Possible solutions
- Do nothing, possibly document that
manylinuxwheels will use outdated versions of these libraries. - Drop
manylinux2014in favor of a newer PEP600 version based onglibc, possiblymanylinux_2_36(which covers contemporary distros like Debian 12). This would result in newer version being bundled, but wouldn't completely resolve the issue. - Change the configuration to dynamically link to system versions of these libraries. This would require users to ensure these packages are installed (which is already done in the docs). This would lead to some users running into issues if they blindly install
skia-pythonwithout the necessary packages.
Version comparison
| Library | Bundled | Debian Trixie |
|---|---|---|
| libbz2 | 1.0.6 | 1.0.8-6 |
| libfontconfig | 1.11.1 | 2.15.0-1.1 |
| libfreetype | 6.14.0 | 6.20.2 |
| libpng | 1.5.13.0 | 1.6.44-2 |
| libuuid | 1.3.0 | 2.40.2-11 |
Metadata
Metadata
Assignees
Labels
No labels