Closed sylmio closed 4 years ago
@sylmio Thanks for the report. Looks like 0.18.4 isn't compatible with qt >= 5.14. They added explicit commands on master to check for the used Qt version and modify the uic/rcc commands accordingly.
Below's a diff of the file cMake/FindPySide2.cmake
from the 0.18.4 sources and github master:
--- cMake/FindPySide2Tools.cmake 2019-10-22 18:53:35.000000000 +0200
+++ /mnt/data/code/github/freecad/cMake/FindPySide2Tools.cmake 2020-01-27 15:33:06.846167266 +0100
@@ -20,8 +20,24 @@
set(PYSIDE_BIN_DIR ${PYTHON_BIN_DIR})
endif(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-FIND_PROGRAM(PYSIDE2UICBINARY NAMES python2-pyside2-uic pyside2-uic pyside2-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
-FIND_PROGRAM(PYSIDE2RCCBINARY NAMES pyside2-rcc pyside2-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
+# Since Qt v5.14, pyside2-uic and pyside2-rcc are directly provided by Qt5Core uic and rcc, with '-g python' option
+# We test Qt5Core version to act accordingly
+
+FIND_PACKAGE(Qt5Core)
+
+IF(Qt5Core_VERSION VERSION_LESS 5.14)
+ # Legacy (< 5.14)
+ FIND_PROGRAM(PYSIDE2UICBINARY NAMES python2-pyside2-uic pyside2-uic pyside2-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
+ FIND_PROGRAM(PYSIDE2RCCBINARY NAMES pyside2-rcc pyside2-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
+ set(UICOPTIONS "")
+ set(RCCOPTIONS "")
+ELSE(Qt5Core_VERSION VERSION_LESS 5.14)
+ # New (>= 5.14)
+ FIND_PROGRAM(PYSIDE2UICBINARY NAMES uic-qt5 uic)
+ set(UICOPTIONS "--generator=python")
+ FIND_PROGRAM(PYSIDE2RCCBINARY NAMES rcc-qt5 rcc)
+ set(RCCOPTIONS "--generator=python" "--compress-algo=zlib" "--compress=1")
+ENDIF(Qt5Core_VERSION VERSION_LESS 5.14)
MACRO(PYSIDE_WRAP_UI outfiles)
FOREACH(it ${ARGN})
@@ -33,7 +49,7 @@
#)
if(WIN32 OR APPLE)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
- COMMAND ${PYSIDE2UICBINARY} ${infile} -o ${outfile}
+ COMMAND ${PYSIDE2UICBINARY} ${UICOPTIONS} ${infile} -o ${outfile}
MAIN_DEPENDENCY ${infile}
)
else()
@@ -41,7 +57,7 @@
# pyside2-uic generates in comments at beginning., which is why
# we follow the tool command with in-place sed.
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
- COMMAND "${PYSIDE2UICBINARY}" "${infile}" -o "${outfile}"
+ COMMAND "${PYSIDE2UICBINARY}" ${UICOPTIONS} "${infile}" -o "${outfile}"
COMMAND sed -i "/^# /d" "${outfile}"
MAIN_DEPENDENCY "${infile}"
)
@@ -60,7 +76,7 @@
#)
if(WIN32 OR APPLE)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
- COMMAND ${PYSIDE2RCCBINARY} ${infile} -o ${outfile}
+ COMMAND ${PYSIDE2RCCBINARY} ${RCCOPTIONS} ${infile} -o ${outfile}
MAIN_DEPENDENCY ${infile}
)
else()
@@ -68,7 +84,7 @@
# pyside-rcc generates in comments at beginning, which is why
# we follow the tool command with in-place sed.
ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
- COMMAND "${PYSIDE2RCCBINARY}" "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
+ COMMAND "${PYSIDE2RCCBINARY}" ${RCCOPTIONS} "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
COMMAND sed -i "/^# /d" "${outfile}"
MAIN_DEPENDENCY "${infile}"
)
There are two ways to solve this. First is using the live ebuild, which should work. Second is downgrading to Qt 5.13, because I need to change the ebuild to depend on <5.14 for the 0.18.4 sources to work.
Maybe there's a third way. I'm currently trying to backport the changes to 0.18.4.
Looks like the backport worked. Please let me know, if you encounter any issues related to the PR.
I had pyside2 and shiboken2 5.12.5 installed, that might have not been compatible with qt 5.14. And one patch was not applied on pyside2. Might be the problem. I am currently recompiling and will report if it solves the problem.
I used last ebuild and indeed Draft workbench works ! Thank you
Compile went fine. When selecting Draft workbench, Freecad crashes form a sigsegv. The error message:
(I did not include following lines)
I investigated a little. I just recompiled with qt 5.14, and it was working before with a custom ebuild without rcc/uic with qt 5.13. I happened to have Draft_rc.py compiled without rcc/uic and qt 5.13 and the missing icons are embedded in it. But I looked at new installed Draft_rc.py and the icons are not embedded in it. I don't know about python and freecad developpment, so I did not investigate further. I hope you can help.
Here additional information:
cat /var/log/portage/elog/media-gfx/freecad-0.18.4-r1\:20200325-084741.log
emerge --info =media-gfx/freecad-0.18.4-r1::waebbl