goToMain / libosdp

Implementation of IEC 60839-11-5 OSDP (Open Supervised Device Protocol); provides a C library with support for C++, Rust and Python3
https://libosdp.sidcha.dev
Apache License 2.0
138 stars 71 forks source link

Cannot import osdp library from python3.9 #63

Closed qdx closed 3 years ago

qdx commented 3 years ago

Describe the bug After successfully building and installing the python library, error was encountered when trying to import the osdp library.

Expected behavior The osdp library should be imported without error.

Observed behavior When importing the osdp library via import osdp, below error is encountered:

➜  build git:(15) ✗ python3.9
Python 3.9.5 (default, May  4 2021, 03:36:27)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import osdp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/dexinqi/Library/Python/3.9/lib/python/site-packages/osdp-1.5.0-py3.9-macosx-11-x86_64.egg/osdp.cpython-39-darwin.so, 2): Symbol not found: _hash32_djb2
  Referenced from: /Users/dexinqi/Library/Python/3.9/lib/python/site-packages/osdp-1.5.0-py3.9-macosx-11-x86_64.egg/osdp.cpython-39-darwin.so
  Expected in: flat namespace
 in /Users/dexinqi/Library/Python/3.9/lib/python/site-packages/osdp-1.5.0-py3.9-macosx-11-x86_64.egg/osdp.cpython-39-darwin.so

Additional context I'm on macOS 11.4 This issues is encountered in version 771eae5, the current master. This issues does not exist in release v1.4.0

sidcha commented 3 years ago

@qdx, thanks for reporting the issue. the c-utils submodule when through some cleanup which has caused this issue. I've fixed it now.

sidcha commented 3 years ago

Also added PyOSDP builds and import check to CI builds. This should not happen again, sorry about the hassle.