udevbe / greenfield

HTML5 Wayland compositor :seedling:
GNU Affero General Public License v3.0
901 stars 27 forks source link

[Build] Missing header (gstgldisplay_egl_device.h) #108

Closed markusbkk closed 1 year ago

markusbkk commented 1 year ago

Attempting to build (yarn build:native) the compositor-proxy fails with the following trace:

FAILED: CMakeFiles/proxy-encoding.dir/native/src/gst_encoder.c.o
/usr/bin/cc -Dproxy_encoding_EXPORTS -I../node_modules/westfield-proxy/dist/include -isystem /usr/include/gstreamer-1.0 -isystem /usr/lib/x86_64-linux-gnu/gstreamer-1.0/include -isystem /usr/include/libdrm -isystem /usr/include/orc-0.4 -isystem /usr/include/graphene-1.0 -isystem /usr/lib/x86_64-linux-gnu/graphene-1.0/include -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -O3 -DNDEBUG -fPIC   -mfpmath=sse -msse -msse2 -pthread -std=gnu99 -MD -MT CMakeFiles/proxy-encoding.dir/native/src/gst_encoder.c.o -MF CMakeFiles/proxy-encoding.dir/native/src/gst_encoder.c.o.d -o CMakeFiles/proxy-encoding.dir/native/src/gst_encoder.c.o   -c ../native/src/gst_encoder.c
../native/src/gst_encoder.c:9:10: fatal error: gst/gl/egl/gstgldisplay_egl_device.h: No such file or directory
    9 | #include <gst/gl/egl/gstgldisplay_egl_device.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
error Command failed with exit code 1.

OS: WSL2 (Ubuntu 20.04.5 LTS)

I hooked into vcpkg and it didn't find any missing packages, so this must be some sort of version mismatch?

Zubnix commented 1 year ago

Yes indeed, ubuntu 20.04 uses gstreamer 1.16 while the required header is in gstreamer 1.18. I'll see if I can make the version requirement more strict.

markusbkk commented 1 year ago

Yes indeed, ubuntu 20.04 uses gstreamer 1.16 while the required header is in gstreamer 1.18. I'll see if I can make the version requirement more strict.

Thanks! That helped.

For anybody else running into this issue, they can update GStreamer through a PPA.

sudo add-apt-repository ppa:miurahr/gst
sudo apt update
sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav

Still running into issues launching the proxy and module at the same time (somehow, one of the two will connect to the wrong port), but that's probably just my own device being wonky RN. Nothing a reboot can't resolve.

PS: The documentation says to copy app-endpoint-encoding.node. Shouldn't it be proxy-encoding-addon.node?

Zubnix commented 1 year ago

PS: The documentation says to copy app-endpoint-encoding.node. Shouldn't it be proxy-encoding-addon.node?

Good catch. That was renamed not so long ago and the documentation was not updated it seems. I'll fix that.

Zubnix commented 1 year ago

I've written up a short "tl;dr" set of commands starting from a vanilla WSL Ubuntu 22.04 install. This works for me but I've might missed some steps while setting everything up. Let me know if anything is not working for you.

Tested using: node v18 ubuntu 22.04

Open a new terminal for running the compositor-proxy:

Open a new terminal for running the compositor-module:

Open a new terminal for running the program:

Open a browser and go to localhost:8080 and click the button below that connects to localhost:8081

markusbkk commented 1 year ago

Thanks! Works as advertised now. Strangely, XWayland allows HandleResize events in situations in which they shouldn't and just fail silently on other X Servers.

screen-capture (2)

Zubnix commented 1 year ago

Yeah the current X Window Manager implemented in Greenfield is not entirely EWMH/ICCCM compliant and is basically a typescript port of Weston's X Window Manager. There are definitely improvements to be made.

markusbkk commented 1 year ago

Yeah the current X Window Manager implemented in Greenfield is not entirely EWMH/ICCCM compliant and is basically a typescript port of Weston's X Window Manager. There are definitely improvements to be made.

Microsoft's own Weston port exhibits the same behavior so I assumed this would be deeper down the stack.

Zubnix commented 1 year ago

Fixed by PR #110