HumbleUI / Skija

Java bindings for Skia
Apache License 2.0
498 stars 34 forks source link

Include EGL #63

Closed TheDrawingCoder-Gamer closed 8 months ago

TheDrawingCoder-Gamer commented 8 months ago

Includes EGL as a dependency. Wayland needs this dependency to use LayerGLSkija.

TheDrawingCoder-Gamer commented 8 months ago

converting to draft bc this is going to be more complex than anticipated

tonsky commented 8 months ago

Ok let me know when it’s ready to merge

TheDrawingCoder-Gamer commented 8 months ago

Ready to merge - much less complex than anticipated.

tonsky commented 8 months ago

Please take a look https://github.com/HumbleUI/Skija/actions/runs/7145633086/job/19461717870

TheDrawingCoder-Gamer commented 8 months ago

Bumping version, works on my machine. Maybe lack of dependencies?

tonsky commented 8 months ago

Yeah, which ones?

TheDrawingCoder-Gamer commented 8 months ago

Unsure, maybe EGL version is outdated? My local version is 1.1.0 (with an archlinux package version of 1.7.0 for libglvnd). If it were missing though, it shouldn't be able to build.

TheDrawingCoder-Gamer commented 8 months ago

It looks like others have to pull in libEGL: https://github.com/BlGene/egl_check/blob/master/.github/workflows/c-cpp.yml

(which makes sense - you already have to install mesa for normal gl)

tonsky commented 8 months ago

What’s the name of the dependency? To add here https://github.com/HumbleUI/Skija/blob/856859e51be59ba52dc498744e7efaf3d1b94567/.github/workflows/build.yml#L50-L53

dzaima commented 8 months ago

libegl1-mesa libegl1-mesa-dev I think.

tonsky commented 8 months ago

Still doesn’t work

Screenshot 2023-12-11 at 16 30 01

Screenshot 2023-12-11 at 16 29 42

dzaima commented 8 months ago

dpkg-query -S /usr/lib/x86_64-linux-gnu/libEGL.so gives libegl-dev for me, so that maybe? Unsure though, weird that it compiles but then fails to run.

tonsky commented 8 months ago

still no, same error

TheDrawingCoder-Gamer commented 8 months ago

It's possible EGL is like GLX, although I had thought that it was more compatible. You may have to pull in stuff.

Maybe mesa-utils-extra?

this is why I don't like CI : (

tonsky commented 8 months ago

this is why I don't like CI

Why? Because you have to spell out every dependency? What other way is there? Building it on your own computer?

TheDrawingCoder-Gamer commented 8 months ago

it's a lot of trial and error for something that takes 30 minutes to run

tonsky commented 8 months ago

I think you should be able to enable github actions in your fork and play with the dependency name there. The environment should be the same, sans secrets (these are only needed for publishing, so shouldn’t be a problem)

TheDrawingCoder-Gamer commented 8 months ago

https://github.com/TheDrawingCoder-Gamer/Skija/actions/runs/7213144238/job/19652346199#step:4:108 it seems that it isn't linked in at build time?

TheDrawingCoder-Gamer commented 8 months ago

compare to my local build:

local ldd

    linux-vdso.so.1 (0x00007ffc459c8000)
    libEGL.so.1 => /usr/lib/libEGL.so.1 (0x00007f5240acd000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f52409ff000)
    libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f523f17a000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007f523f12b000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f523ee00000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007f523ed13000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f523f106000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f523eb31000)
    /usr/lib64/ld-linux-x86-64.so.2 (0x00007f5240b20000)
    libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007f523ea79000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007f523f0ec000)
    libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f523f0d9000)
    libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f523f09f000)
    libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007f523e96b000)
    libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x00007f523f090000)
    libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007f523e939000)
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f523e90e000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f523e7c2000)
    libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007f523e79f000)
    libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x00007f523e77c000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f523e639000)
    libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x00007f523e59e000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f523e573000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f52409f2000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f523f088000)

TheDrawingCoder-Gamer commented 8 months ago

pacman -Qo /usr/lib/libEGL.so returns libglvnd - but I download libglvnd-dev : /. is it possible that it never actually looks in /usr/lib? https://packages.ubuntu.com/focal/amd64/libegl-dev/filelist this is the file list of libegl-dev.... /usr/lib/x86_64-linux-gnu/libEGL.so.... this doesn't really make sense tho. No idea why it's pointing into /lib and not /usr/lib.

TheDrawingCoder-Gamer commented 8 months ago

ld can still find libEGL, so it's defo installed. No idea why it's missing a link. Notably, I also have libEGL_mesa installed but this isn't required in any way. This SHOULD be working but for some reason it just... isn't? Again this is why I don't like CI, trial and error where each trial takes 5 minutes, instead of the 1 minute for local builds.

TheDrawingCoder-Gamer commented 8 months ago

ldconfig says that yes, EGL is installed?

    libEGL_mesa.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libEGL_mesa.so.0
    libEGL.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libEGL.so.1
    libEGL.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libEGL.so
TheDrawingCoder-Gamer commented 8 months ago

It also finds EGL while linking, but it finds it in /usr/lib/x86_64-linux-gnu/libEGL.so

No idea why ldd says it isn't linked. It SHOULD be linking.

also, I can't actually build locally without including <cstdint>. No idea what is different, I'm trying to install gcc-9 rn to try to use the correct gcc version.

TheDrawingCoder-Gamer commented 8 months ago

!!! You have to link it in earlier.

Look at changes to the FindSkia cmake file and CMakeLists file.

Works for me : )

tonsky commented 8 months ago

Ok I published 0.116.2, let me know if it works for you and if it does, please close this PR

TheDrawingCoder-Gamer commented 8 months ago

Yep, works locally. Closing.