PySide6: error when compiling from source code
-
Hi everyone,
I want to wrap a C++ library to use it with Python and therefore wanted to create PoC and give Shiboken6 a try. So far I got Qt, Ninja and Cmake using the Qt Online installer. I also cloned PySide from the Qt repo and checked out the correct branch matching the Qt version I have downloaded (6.2.2). Ninja is also added to the PATH environment variable.
Some details of the system I am running:
- Ubuntu 20.04
- Python 3.8.10 (used venv to create a virtual environment)
- CLang10 (via apt)
However when I run:
python3 setup.py build --qmake=<my_qmake_path> --cmake=<my_cmake_path> --build-tests --parallel=8
shiboken6 and shiboken6_generator are build (I see them in site-packages) but not pyside6.
The error I get is the following:
[931/999] cd /home/users/user123/pyside-setup/QtShiboken3_bui...qt6.2.2-64bit-release/lib/python3.8/site-packages/shiboken6/.. FAILED: PySide6/QtQuick/CMakeFiles/QtQuick_pyi /home/users/user123/pyside-setup/QtShiboken3_build/py3.8-qt6.2.2-64bit-release/pyside6/PySide6/QtQuick/CMakeFiles/QtQuick_pyi cd /home/users/user123/pyside-setup/QtShiboken3_build/py3.8-qt6.2.2-64bit-release/pyside6/PySide6/QtQuick && /home/users/user123/Qt/Tools/CMake/bin/cmake -E env LD_LIBRARY_PATH=/home/users/user123/pyside-setup/QtShiboken3_build/py3.8-qt6.2.2-64bit-release/pyside6/libpyside:/home/users/user123/pyside-setup/QtShiboken3_install/py3.8-qt6.2.2-64bit-release/lib /home/users/user123/VirtualEnvironments/QtShiboken/bin/python3 /home/users/user123/pyside-setup/sources/pyside6/PySide6/QtQuick/../support/generate_pyi.py QtQuick --sys-path /home/users/user123/pyside-setup/QtShiboken3_build/py3.8-qt6.2.2-64bit-release/pyside6 /home/users/user123/pyside-setup/QtShiboken3_install/py3.8-qt6.2.2-64bit-release/lib/python3.8/site-packages/shiboken6/.. Traceback (most recent call last): File "/home/users/user123/pyside-setup/sources/pyside6/PySide6/QtQuick/../support/generate_pyi.py", line 130, in <module> generate_all_pyi(outpath, options=options) File "/home/users/user123/pyside-setup/sources/pyside6/PySide6/QtQuick/../support/generate_pyi.py", line 97, in generate_all_pyi with feature.force_selection(feature_id, import_name): File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__ return next(self.gen) File "shibokensupport/feature.py", line 220, in force_selection ImportError: /home/users/user123/pyside-setup/QtShiboken3_build/py3.8-qt6.2.2-64bit-release/pyside6/PySide6/QtQuick.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN18QQuickRenderTarget15fromVulkanImageEyiRK5QSizei [938/999] Building CXX object PySide6/QtQuickWidgets/CMakeFile...kWidgets.dir/PySide6/QtQuickWidgets/qquickwidget_wrapper.cpp.o ninja: build stopped: subcommand failed. Traceback (most recent call last): File "setup.py", line 78, in <module> setup_runner.run_setup() File "/home/users/user123/pyside-setup/build_scripts/setup_runner.py", line 137, in run_setup self.run_setuptools_setup() File "/home/users/user123/pyside-setup/build_scripts/setup_runner.py", line 192, in run_setuptools_setup setup(**kwargs) File "/home/users/user123/VirtualEnvironments/QtShiboken/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/users/user123/pyside-setup/build_scripts/main.py", line 546, in run self.build_extension(ext) File "/home/users/user123/pyside-setup/build_scripts/main.py", line 884, in build_extension raise DistutilsSetupError(f"Error compiling {extension}") setuptools._distutils.errors.DistutilsSetupError: Error compiling pyside6 Traceback (most recent call last): File "setup.py", line 78, in <module> setup_runner.run_setup() File "/home/users/user123/pyside-setup/build_scripts/setup_runner.py", line 178, in run_setup raise RuntimeError(msg) RuntimeError: setup.py invocation failed with exit code: 1. setup.py invocation was: /home/users/user123/VirtualEnvironments/QtShiboken/bin/python3 setup.py build --qmake=/home/users/user123/Qt/6.2.2/gcc_64/bin/qmake --cmake=/home/users/user123/Qt/Tools/CMake/bin/cmake --parallel=8 --build-tests --internal-build-type=pyside6
I tried to look for answers in the holly Stackoverflow and here in the forums but couldn't find anything (maybe I missed something, sorry if that's the case).
Could someone shed some light on what could be wrong?
Thanks a lot.
D.
-
Hi and welcome to devnet,
Not a direct answer but since you only want to use shiboken, why not install it through pip ?
-
Well I was just following a tutorial I found in youtube from one of your Qt colleagues. I thought shiboken, shiboken_generator and pyside were all required.
In any case I will stop PySide6 testing for the time being and continue my proof of concept with PySide2. I managed to compile everything without any problems using Qt and PySide versions 5.15.2
If development team is interested in reproducing the scenario that made my local PySide6 compilation crash let me know :-)
Cheers,
D. -
Since you have a pretty reliable way to trigger the crash, sure, open a report providing the step by step instructions to reproduce this :-)