I’m trying to test out some crypto hardware on a device, and I need to make it a snap to run on Core18. I’ve managed to get a snap to build and install, but it’s throwing errors when it runs.
Traceback (most recent call last):
File "/snap/crypto-test/x1/bin/crypto_test.py", line 6, in <module>
from cryptoauthlib import *
File "/snap/crypto-test/x1/lib/python3.6/site-packages/cryptoauthlib/__init__.py", line 16, in <module>
load_cryptoauthlib()
File "/snap/crypto-test/x1/lib/python3.6/site-packages/cryptoauthlib/library.py", line 83, in load_cryptoauthlib
_CRYPTO_LIB = ctypes.cdll.LoadLibrary(os.path.join(curr_path, "libcryptoauth.so"))
File "/snap/crypto-test/x1/usr/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
return self._dlltype(name)
File "/snap/crypto-test/x1/usr/lib/python3.6/ctypes/__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /snap/crypto-test/x1/lib/python3.6/site-packages/cryptoauthlib/libcryptoauth.so: undefined symbol: hid_open
I’ve tried including a whole slew of stuff in the snap to try to solve this with no success. Here is my part
from snapcraft.yaml
crypto-test:
source: .
plugin: python
python-version: 'python3'
python-packages:
- cryptoauthlib
- hidapi
- setuptools
stage-packages:
- libusb-dev
- libhidapi-dev
- libusb-1.0-0
Here is my setup.py
setup(
name="crypto-test",
version="0.1",
packages=['bin'],
scripts=['bin/crypto_test.py'],
install_requires=['cryptoauthlib', 'hidapi'],
)
I’m building on a RasPi 4 targeting an armhf
device.
Has anyone tried to use cryptoauthlib
in a snap before? How does one solve this issue? Best guess right now is that I’m missing some kind, variety, or flavor of a hid
library.