xmlsec / python-xmlsec

Python bindings for the XML Security Library.
MIT License
95 stars 99 forks source link

Failing to build functional manylinux wheels #191

Closed philipdouglas closed 3 years ago

philipdouglas commented 3 years ago

I've been using the instructions that @hoefling shared in an older issue for building python xmlsec into a manylinux wheel to build one in order to deploy on an Ubuntu server, where I can't get the package to build locally.

I have successfully built the wheel, and it installs fine (both in the docker container and on the Ubuntu server), but when I try to import xmlsec in python, I get this error:

>>> import xmlsec
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/main.c:235 PyInit_xmlsec] 0x7f1106ad0d18
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/main.c:36 PyXmlSec_GetCryptoLibName] dynamic crypto library: openssl
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/exception.c:55 PyXmlSec_ErrorHolderCreate] new error 0x1b0ed30
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/exception.c:84 PyXmlSec_ExchangeLastError] set_key_value returns 0
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/exception.c:55 PyXmlSec_ErrorHolderCreate] new error 0x1aadaa0
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/exception.c:84 PyXmlSec_ExchangeLastError] set_key_value returns 0
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/exception.c:61 PyXmlSec_ErrorHolderFree] free error 0x1b0ed30
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/exception.c:55 PyXmlSec_ErrorHolderCreate] new error 0x1b0ed30
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/exception.c:84 PyXmlSec_ExchangeLastError] set_key_value returns 0
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/exception.c:61 PyXmlSec_ErrorHolderFree] free error 0x1aadaa0
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/exception.c:84 PyXmlSec_ExchangeLastError] set_key_value returns 0
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/exception.c:61 PyXmlSec_ErrorHolderFree] free error 0x1b0ed30
[/tmp/pip-wheel-pikoo161/xmlsec_2a53dc9f31c041d88917dc8f44fd7742/src/main.c:42 PyXmlSec_Free] free resources 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
xmlsec.Error: (1, 'cannot load crypto library for xmlsec.')

Note: this is with PYXMLSEC_ENABLE_DEBUG=1 in order to check that the crpyto library was the one I thought it was.

Am I missing something in the wheel build process?

philipdouglas commented 3 years ago

It turns out the problem was I was using STATIC_DEPS instead of PYXMLSEC_STATIC_DEPS which meant it didn't actually build with static dependencies. I did actually try the latter yesterday, but there was a problem with the libxslt build that made me think it hadn't work, which I've raised in #192.