Details
Description
When building PySide2 using python27 that is enabled with scl enable python27 bash , Python crashes trying to import the io and subsequent _io modules with the following error:
cd /home/S/workspace/pyside_5.12.2/src/pyside2_build/py2.7-qt5.12.2-64bit-release/pyside2/PySide2/QtCore && /usr/bin/cmake3 -E env LD_LIBRARY_PATH=/home/S/workspace/pyside_5.12.2/src/pyside2_build/py2.7-qt5.12.2-64bit-release/pyside2/libpyside:/home/S/workspace/pyside_5.12.2/src/pyside2_install/py2.7-qt5.12.2-64bit-release/lib /opt/rh/python27/root/usr/bin/python /home/S/workspace/pyside_5.12.2/src/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py run --skip --sys-path /home/S/workspace/pyside_5.12.2/src/pyside2_build/py2.7-qt5.12.2-64bit-release/pyside2 /home/S/workspace/pyside_5.12.2/src/pyside2_install/py2.7-qt5.12.2-64bit-release/lib64/python2.7/site-packages/shiboken2
Traceback (most recent call last):
{{ File "/home/S/workspace/pyside_5.12.2/src/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py", line 51, in <module>}}
{{ import io}}
{{ File "/opt/rh/python27/root/usr/lib64/python2.7/io.py", line 51, in <module>}}
{{ import _io}}
ImportError: /opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_io.so: undefined symbol: _PyErr_ReplaceException
PySide2/QtCore/CMakeFiles/QtCore_pyi.dir/build.make:57: recipe for target 'PySide2/QtCore/CMakeFiles/QtCore_pyi' failed
make[2]: *** [PySide2/QtCore/CMakeFiles/QtCore_pyi] Error 1
This is caused because the cmake3 invocation clears and sets LD_LIBRARY_PATH. One of the things that scl enable python27 bash does to add the selected program for use is to add the library paths to these tools to LD_LIBRARY_PATH. cmake3 clearing this means that a different set of python libraries (the system ones) will be loaded instead, which results in a mismatch between the python executable and it's shared libraries.
Attachments
Issue Links
- relates to
-
PYSIDE-843 PySide2 does not link to bundle Qt libraries by default
- Closed