Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing Symbol: Py_AddObject #342

Open
0-wiz-0 opened this issue Mar 14, 2023 · 0 comments
Open

missing Symbol: Py_AddObject #342

0-wiz-0 opened this issue Mar 14, 2023 · 0 comments

Comments

@0-wiz-0
Copy link

0-wiz-0 commented Mar 14, 2023

I've packaged yubikey-manager-qt-1.2.5 for pkgsrc using pyotherside 1.6.0 and qt5.
When I start it up, I see:

"PyOtherSide error: ImportError: PyCapsule_Import could not import module \"datetime\"\n\n\nThe above exception was the direct cause of the following exception:\n\n\nTraceback (most recent call last):\n\n  File \"<frozen site>\", line 212, in addsitedir\n\n  File \"<frozen site>\", line 149, in _init_pathinfo\n\nSystemError: <class 'set'> returned a result with an exception set\n"
qml: Return value of PyObject call is NULL: ImportError: PyCapsule_Import could not import module "datetime"


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File "<frozen site>", line 212, in addsitedir

  File "<frozen site>", line 149, in _init_pathinfo

SystemError: <class 'set'> returned a result with an exception set

"PyOtherSide error: Traceback (most recent call last):\n\n  File \"qrc://io/thp/pyotherside/qrc_importer.py\", line 21, in <module>\n\n  File \"/usr/pkg/lib/python3.11/importlib/abc.py\", line 19, in <module>\n    from .resources.abc import ResourceReader, Traversable, TraversableResources\n\n  File \"/usr/pkg/lib/python3.11/importlib/resources/__init__.py\", line 3, in <module>\n    from ._common import (\n\n  File \"/usr/pkg/lib/python3.11/importlib/resources/_common.py\", line 3, in <module>\n    import tempfile\n\n  File \"/usr/pkg/lib/python3.11/tempfile.py\", line 45, in <module>\n    from random import Random as _Random\n\n  File \"/usr/pkg/lib/python3.11/random.py\", line 49, in <module>\n    from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil\n\nImportError: /usr/pkg/lib/python3.11/lib-dynload/math.so: Undefined PLT symbol \"PyModule_AddObject\" (symnum = 4)\n"
qml: Cannot exec qrc importer: Traceback (most recent call last):

  File "qrc://io/thp/pyotherside/qrc_importer.py", line 21, in <module>

  File "/usr/pkg/lib/python3.11/importlib/abc.py", line 19, in <module>
    from .resources.abc import ResourceReader, Traversable, TraversableResources

  File "/usr/pkg/lib/python3.11/importlib/resources/__init__.py", line 3, in <module>
    from ._common import (

  File "/usr/pkg/lib/python3.11/importlib/resources/_common.py", line 3, in <module>
    import tempfile

  File "/usr/pkg/lib/python3.11/tempfile.py", line 45, in <module>
    from random import Random as _Random

  File "/usr/pkg/lib/python3.11/random.py", line 49, in <module>
    from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil

ImportError: /usr/pkg/lib/python3.11/lib-dynload/math.so: Undefined PLT symbol "PyModule_AddObject" (symnum = 4)

"PyOtherSide error: No module named 'yubikey'"
qml: Cannot import module: yubikey (No module named 'yubikey')
"PyOtherSide error: Traceback (most recent call last):\n\n  File \"<string>\", line 1, in <module>\n\nNameError: name 'yubikey' is not defined\n"
qml: Function not found: 'yubikey.init' (Traceback (most recent call last):

  File "<string>", line 1, in <module>

NameError: name 'yubikey' is not defined
)

The symbol is provided by libpython3.11.so, and /usr/pkg/qt5/qml/io/thp/pyotherside/libpyothersideplugin.so is linked against this library; however ykman-gui is not.

When I link ykman-gui against libpython manually, e.g. using

SUBLIBS=-lpython3.11

it starts up fine.

The generated file ykman-gui/Makefile has:

LIBS         += $(SUBLIBS) -L/usr/pkg/lib /usr/pkg/qt5/lib/libQt5QuickControls2.so /usr/pkg/qt5/lib/libQt5Quick.so /usr/pkg/qt5/lib/libQt5Widgets.so /usr/pkg/qt5/lib/libQt5Gui.so /usr/pkg/qt5/lib/libQt5QmlModels.so /usr/pkg/qt5/lib/libQt5Qml.so /usr/pkg/qt5/lib/libQt5Network.so /usr/pkg/qt5/lib/libQt5Core.so -lGL   

so it already explicitly links against all the other libraries that pyotherside uses.

If you think this is a bug in pyotherside instead (or the packaging), please let me know. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant