eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
118 stars 137 forks source link

libswt should properly load with gtk/gdk that have NO x11 built-in #750

Open atmouse- opened 1 year ago

atmouse- commented 1 year ago

I'm launching dbeaver with libswt library, libswt-pi3-gtk-4960r6.so loads failed with undefined symbol: gdk_x11_display_get_type

DETAIL here

./dbeaver
> Start DBeaver Standalone [org.jkiss.dbeaver.ui.app.standalone 23.1.2.202307091549]                                                                                                                                                    
> Start Eclipse IDE UI Application [org.eclipse.ui.ide.application 1.5.0.v20230526-1051]                                                                                                                                                
> Start Eclipse Jobs Mechanism [org.eclipse.core.jobs 3.14.0.v20230317-0901]                                                                                                                                                            
/home/atmouse/.local/opt/dbeaver/jre/bin/java: symbol lookup error: /home/atmouse/.local/opt/dbeaver/configuration/org.eclipse.osgi/143/0/.cp/libswt-pi3-gtk-4960r6.so: undefined symbol: gdk_x11_display_get_type 

To Reproduce Gentoo OS that gtk build with wayland only(without x11 support flag) x11-libs/gtk+-3.24.38

download dbeaver zip binary and perform.

Expected behavior dbeaver with libswt should properly bootup on wayland-only platform

Screenshots If applicable, add screenshots to help explain your problem.

Environment:

  1. Select the platform(s) on which the behavior is seen:

      • [ ] All OS
      • [ ] Windows
      • [x] Linux
      • [ ] macOS
  2. Additional OS info (e.g. OS version, Linux Desktop, etc) wayland/swaywm

Related There has similar issue from firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1614266

EDIT: ldd additional

ldd /home/atmouse/.local/opt/dbeaver/configuration/org.eclipse.osgi/143/0/.cp/libswt-pi3-gtk-4960r6.so                                                                                         
ldd: warning: you do not have execution permission for `/home/atmouse/.local/opt/dbeaver/configuration/org.eclipse.osgi/143/0/.cp/libswt-pi3-gtk-4960r6.so'                                                                             
        linux-vdso.so.1 (0x00007ffff7fc9000)
        libgtk-3.so.0 => /usr/lib64/libgtk-3.so.0 (0x00007ffff7400000)
        libgdk-3.so.0 => /usr/lib64/libgdk-3.so.0 (0x00007ffff7f03000)
        libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00007ffff72ed000)
        libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007ffff7efe000)
        libc.so.6 => /usr/lib64/libc.so.6 (0x00007ffff7119000)
        libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007ffff7ef7000)
        libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007ffff6fd6000)
        libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007ffff7e94000)
        libgio-2.0.so.0 => /usr/lib64/libgio-2.0.so.0 (0x00007ffff6df2000)
        libpangocairo-1.0.so.0 => /usr/lib64/libpangocairo-1.0.so.0 (0x00007ffff7e83000)
        libpango-1.0.so.0 => /usr/lib64/libpango-1.0.so.0 (0x00007ffff6d87000)
        libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so.0 (0x00007ffff6c6c000)
        libpangoft2-1.0.so.0 => /usr/lib64/libpangoft2-1.0.so.0 (0x00007ffff7be8000)
        libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007ffff6c1f000)
        libfribidi.so.0 => /usr/lib64/libfribidi.so.0 (0x00007ffff6bff000)
        libcairo-gobject.so.2 => /usr/lib64/libcairo-gobject.so.2 (0x00007ffff7e76000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib64/libgdk_pixbuf-2.0.so.0 (0x00007ffff6bd0000)
        libatk-1.0.so.0 => /usr/lib64/libatk-1.0.so.0 (0x00007ffff6ba7000)
        libepoxy.so.0 => /usr/lib64/libepoxy.so.0 (0x00007ffff6a78000)
        libm.so.6 => /usr/lib64/libm.so.6 (0x00007ffff699b000)
        libwayland-client.so.0 => /usr/lib64/libwayland-client.so.0 (0x00007ffff7bd6000)
        libxkbcommon.so.0 => /usr/lib64/libxkbcommon.so.0 (0x00007ffff6955000)
        libwayland-cursor.so.0 => /usr/lib64/libwayland-cursor.so.0 (0x00007ffff7bcc000)
        libwayland-egl.so.1 => /usr/lib64/libwayland-egl.so.1 (0x00007ffff6950000)
        libz.so.1 => /usr/lib64/libz.so.1 (0x00007ffff6936000)
        libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007ffff68fc000)
        libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007ffff6832000)
        libpixman-1.so.0 => /usr/lib64/libpixman-1.so.0 (0x00007ffff6789000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ffff7fcb000)
        libpcre2-8.so.0 => /usr/lib64/libpcre2-8.so.0 (0x00007ffff66ee000)
        libffi.so.8 => /usr/lib64/libffi.so.8 (0x00007ffff66e2000)
        libmount.so.1 => /usr/lib64/libmount.so.1 (0x00007ffff6681000)
        libgraphite2.so.3 => /usr/lib64/libgraphite2.so.3 (0x00007ffff665b000)
        libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007ffff6630000)
        libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x00007ffff659d000)
        libbz2.so.1 => /usr/lib64/libbz2.so.1 (0x00007ffff6588000)
        libblkid.so.1 => /usr/lib64/libblkid.so.1 (0x00007ffff6530000)
akurtakov commented 1 year ago

GTK without x11 is not common thing (yet) thus the very scarce resources of the project would not be spent on that. We will happily review a patch on the topic though.

laeubi commented 1 year ago

I think the final solution would be to not statically bind to the libs using JNI but using more modern approaches with Project Panama I already use this in some of my projects and it literally works great and is fantastic way to interop with native libs.

But this is nothing one can do "just for fun" on a large project like SWT and it will need some substantial refactoring and work, I have done some prototyping on this but fear it either would require a donation in form of money or very dedicated developer resources.