waebbl / waebbl-gentoo

Personal overlay of gentoo ebuilds, loosely focused on the 3D domain.
17 stars 17 forks source link

Draft workbench crash due to missing icons #218

Closed sylmio closed 4 years ago

sylmio commented 4 years ago

Compile went fine. When selecting Draft workbench, Freecad crashes form a sigsegv. The error message:

Cannot find icon: Draft_Line
Cannot find icon: Draft_Wire
Cannot find icon: Draft_Circle
Cannot find icon: Draft_Arc
Cannot find icon: Draft_Ellipse
Cannot find icon: Draft_Polygon
Cannot find icon: Draft_Rectangle
Program received signal SIGSEGV, Segmentation fault.
#0  /lib64/libc.so.6(+0x38de0) [0x7f4f3c726de0]
#1  /lib64/libc.so.6(+0x16ddd4) [0x7f4f3c85bdd4]
#2  /usr/lib64/libQt5Core.so.5(+0x1d1fb6) [0x7f4f3cd22fb6]
#3  0x7f4f3cd0dd3b in QFileDevice::readData(char*, long long) from /usr/lib64/libQt5Core.so.5+0x7b
#4  0x7f4f3cd14730 in QIODevicePrivate::read(char*, long long, bool) from /usr/lib64/libQt5Core.so.5+0x1a0
#5  0x7f4f3cd15343 in QIODevice::readAll() from /usr/lib64/libQt5Core.so.5+0x2a3
#6  0x7f4f3e3db8ca in Gui::BitmapFactoryInst::loadPixmap(QString const&, QPixmap&) const from /usr/lib64/freecad/lib64/libFreeCADGui.so+0x13a
#7  0x7f4f3e3dc02f in Gui::BitmapFactoryInst::pixmap(char const*) const from /usr/lib64/freecad/lib64/libFreeCADGui.so+0x5df
#8  0x7f4f3e3dc72c in Gui::BitmapFactoryInst::iconFromTheme(char const*, QIcon const&) from /usr/lib64/freecad/lib64/libFreeCADGui.so+0x7c
#9  0x7f4f3e443866 in Gui::PythonCommand::createAction() from /usr/lib64/freecad/lib64/libFreeCADGui.so+0x116
#10  0x7f4f3e44214e in Gui::Command::addTo(QWidget*) from /usr/lib64/freecad/lib64/libFreeCADGui.so+0x2e
#11  0x7f4f3e4460ee in Gui::CommandManager::addTo(char const*, QWidget*) from /usr/lib64/freecad/lib64/libFreeCADGui.so+0x1ce
#12  0x7f4f3e717d4d in Gui::ToolBarManager::setup(Gui::ToolBarItem*, QToolBar*) const from /usr/lib64/freecad/lib64/libFreeCADGui.so+0x32d
#13  0x7f4f3e7182f3 in Gui::ToolBarManager::setup(Gui::ToolBarItem*) from /usr/lib64/freecad/lib64/libFreeCADGui.so+0x3f3
#14  0x7f4f3e721a85 in Gui::Workbench::activate() from /usr/lib64/freecad/lib64/libFreeCADGui.so+0x35
#15  0x7f4f3e722f90 in Gui::WorkbenchManager::activate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) from /usr/lib64/freecad/lib64/libFreeCADGui.so+0x20

(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

INFO: setup
Package:    media-gfx/freecad-0.18.4-r1
Repository: waebbl
Maintainer: waebbl@gmail.com
Upstream:   https://www.freecadweb.org/tracker/
USE:        abi_x86_64 addonmgr amd64 arch drawing elibc_glibc fem idf image inspection kernel_linux material mesh openscad part_design path points python_single_target_python3_6 raytracing robot show spreadsheet surface techdraw tux userland_GNU
FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
Checking for at least 6 GiB disk space at "/var/tmp/portage/media-gfx/freecad-0.18.4-r1/temp" ...
Using python3.6 to build
INFO: prepare
Applying freecad-0.18.4-0001-Fix-coin-related-variables-to-use-new-naming-from-4.0.0.patch ...
Applying freecad-0.18.4-0002-Fix-PySide-related-checks.patch ...
Applying freecad-0.18.4-0004-fix-std-namespace-issues.patch ...
Working in BUILD_DIR: "/var/tmp/portage/media-gfx/freecad-0.18.4-r1/work/freecad-0.18.4_build"
Hardcoded definition(s) removed in CMakeLists.txt:
     SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "Installa
     SET(CMAKE_INSTALL_PREFIX "/usr/lib${LIB_SUFFIX}/freecad" CACHE PATH "Inst
Applying freecad-0.18.4-0003-cMake-FindPySide2Tools.cmake-use-generator-option.patch ...
INFO: configure
Working in BUILD_DIR: "/var/tmp/portage/media-gfx/freecad-0.18.4-r1/work/freecad-0.18.4_build"
INFO: compile
Working in BUILD_DIR: "/var/tmp/portage/media-gfx/freecad-0.18.4-r1/work/freecad-0.18.4_build"
INFO: install
Working in BUILD_DIR: "/var/tmp/portage/media-gfx/freecad-0.18.4-r1/work/freecad-0.18.4_build"
Final size of build directory: 1096428 KiB (  1.0 GiB)
Final size of installed tree:   353440 KiB (345.1 MiB)
INFO: postinst
Updating .desktop files database ...
Updating shared mime info database ...

emerge --info =media-gfx/freecad-0.18.4-r1::waebbl

Portage 2.3.89 (python 3.6.10-final-0, default/linux/amd64/17.1/desktop/gnome/systemd, gcc-9.2.0, glibc-2.29-r7, 4.19.97-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.97-gentoo-x86_64-Intel-R-_Core-TM-_i5-7300U_CPU_@_2.60GHz-with-gentoo-2.6
KiB Mem:    16037044 total,   8951228 free
KiB Swap:   16601084 total,  16601084 free
Timestamp of repository gentoo: Fri, 20 Mar 2020 00:45:01 +0000
Head commit of repository gentoo: 18c5c5cab882f71e7917ebfaa670478ed07fb41e
Timestamp of repository poly-c: Mon, 23 Mar 2020 10:02:41 +0000
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.32 p2) 2.32.0
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17-r1::gentoo, 3.6.10::gentoo, 3.7.6::gentoo
dev-util/cmake:           3.14.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo, 2.33.1-r1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r7::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.fr.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

gnome
    location: /var/lib/layman/gnome
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/gnome.git
    masters: gentoo
    priority: 50

laurentb
    location: /var/lib/layman/laurentb
    sync-type: laymansync
    sync-uri: https://github.com/laurentb/gentoo-overlay.git
    masters: gentoo
    priority: 50

np-hardass-overlay
    location: /var/lib/layman/np-hardass-overlay
    sync-type: laymansync
    sync-uri: https://github.com/np-hardass/np-hardass-overlay.git
    masters: gentoo
    priority: 50

poly-c
    location: /var/lib/layman/poly-c
    sync-type: laymansync
    sync-uri: rsync://rsync.gentoofan.org/poly-c
    masters: gentoo
    priority: 50

raiagent
    location: /var/lib/layman/raiagent
    sync-type: laymansync
    sync-uri: https://github.com/leycec/raiagent
    masters: gentoo
    priority: 50

robert7k
    location: /var/lib/layman/robert7k
    sync-type: laymansync
    sync-uri: https://github.com/robert7k/gentoo-overlay.git
    masters: gentoo
    priority: 50

waebbl
    location: /var/lib/layman/waebbl
    sync-type: laymansync
    sync-uri: https://github.com/waebbl/waebbl-gentoo.git
    masters: gentoo raiagent
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE no-source-code freedist"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-elog strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://gentoo.modulix.net/gentoo/ http://gentoo.mirrors.ovh.net/gentoo-distfiles/ ftp://mirrors.soeasyto.com/distfiles.gentoo.org/ http://mirrors.soeasyto.com/distfiles.gentoo.org/"
LANG="fr_FR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3 -l2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli colord crypt cups dbus dri dts dvd dvdr eds emboss encode evo exif flac fortran gdbm gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk guile iconv icu introspection ipv6 jpeg lcms ldap libnotify libsecret libtirpc mad mng mp3 mp4 mpeg multilib nautilus ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf php png policykit ppds pulseaudio qt5 readline sdl seccomp spell split-usr ssl startup-notification svg systemd tcpd tiff tracker truetype udev udisks unicode upower usb vorbis wayland wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="emu efi-32 efi-64 pc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6" QEMU_SOFTMMU_TARGETS="arm x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby24 ruby25" SANE_BACKENDS="hp plustek" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

media-gfx/freecad-0.18.4-r1::waebbl was built with the following:
USE="addonmgr arch drawing fem idf image inspection material mesh openscad part_design path points raytracing robot show spreadsheet surface techdraw tux (-assembly) -debug -doc -mpi (-netgen) -pcl -plot -ship" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_6"
waebbl commented 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.

waebbl commented 4 years ago

Maybe there's a third way. I'm currently trying to backport the changes to 0.18.4.

waebbl commented 4 years ago

Looks like the backport worked. Please let me know, if you encounter any issues related to the PR.

sylmio commented 4 years ago

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.

sylmio commented 4 years ago

I used last ebuild and indeed Draft workbench works ! Thank you