Nitrokey / pynitrokey

Python client for Nitrokey devices
Apache License 2.0
98 stars 27 forks source link

libusbsio.so 'symbol not found' error on musl based Linux #468

Closed thyrc closed 10 months ago

thyrc commented 10 months ago

Hi,

it seems pipx install pynitrokey installs a pre-compiled version of the libusbsio library. This leads to an error on musl libc based systems:

Critical error:
An unhandled exception occurred
    Exception encountered: OSError('Error relocating ~/.local/pipx/venvs/pynitrokey/lib/python3.11/site-packages/libusbsio/bin/linux_x86_64/libusbsio.so: __memcpy_chk: symbol not found')

Building the libusbsio from source w/ the musl standard library & exchanging the glibc libusbsio.so version in libusbsio/bin/linux_x86_64/ directory will 'fix' the error, but I was wondering if pipx could build the libraries during the installation (and use any possible toolchain hardening features on the destination host along the way, maybe?) similar to the rust part of the installation. Any thoughts?

robin-nitrokey commented 10 months ago

This would have to be done in the libusbsio package. The library is not part of pynitrokey but only a dependency that we don’t control. I recommend to contact the author listed on the PyPI page.

thyrc commented 10 months ago

Thank you. I contacted the libusbsio package owner, but since the package is a binary library I don't see how this could be handled nicely. I was just wondering if building the library from source could be automated within the pip / pipx / pypi / Python universe without too much trouble.

I'm okay with building the library by hand, that's what you get when you choose weird setups ;)