PyPI binary wheels have wrong hardcoded XML catalog path

Bug #2029411 reported by Janne Pulkkinen
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lxml
Confirmed
Medium
Unassigned

Bug Description

The binary wheels published on PyPI starting with lxml 4.9.3 have a wrong hardcoded default path for the XML catalog file. This causes XML schema discovery to fail unless the XML catalog is specified manually using the `XML_CATALOG_FILES` environment variable. The hardcoded path is compiled as part of the statically linked libxml2, and it defaults to `%{sysconfdir}/xml/catalog`. In newer wheels this points to a temporary build directory instead of `/etc/xml/catalog`.

This can be checked by downloading a whl file from PyPI (https://pypi.org/project/lxml/#files) and extracting the `etree` dynamic library and looking up the string:

```
# From lxml-4.9.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl
❯ strings etree.pypy310-pp73-x86_64-linux-gnu.so | grep "/xml/catalog"
file:///tmp/pip-req-build-svyupjhx/build/tmp/libxml2/etc/xml/catalog

# From lxml-4.9.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
❯ strings etree.pypy39-pp73-x86_64-linux-gnu.so | grep "/xml/catalog"
file:///etc/xml/catalog
```

Possibly a result of CI changes?

description: updated
Revision history for this message
scoder (scoder) wrote :

> Possibly a result of CI changes?

More likely a configuration change in libxml2. Thanks for the report.

This is annoying because for the static build, we do install the libraries into a temporary directory and link them from there. If we set the "sysconfigdir" to "/etc", then the install during the build won't work any more.

Changing the build options for libxml2 depending on the version is also difficult because we don't always know which version of libxml2 we are building against. :-/

Changed in lxml:
importance: Undecided → Medium
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.