From 15b6b18377eb5237dc838cab3bf83556fa2c99ef Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Tue, 19 Mar 2024 12:53:00 -0400 Subject: [PATCH] fix: allow electron 27 to run (#137) Branch for OE changes to support Opentrons/opentrons#14600 Adds a new command line flag to enable remote devtool access on electron 27 and switches out some libraries. --- layers/meta-opentrons/conf/distro/opentrons.conf | 3 +++ .../opentrons-robot-app/opentrons-robot-app.bb | 11 +++++++++-- .../robot-app-wayland-launch_1.0.bb | 16 ++++++++++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/layers/meta-opentrons/conf/distro/opentrons.conf b/layers/meta-opentrons/conf/distro/opentrons.conf index 9d5e5131..9aec336e 100644 --- a/layers/meta-opentrons/conf/distro/opentrons.conf +++ b/layers/meta-opentrons/conf/distro/opentrons.conf @@ -17,3 +17,6 @@ PREFERRED_VERSION_python3-setuptools = "62.3.1" PREFERRED_VERSION_python3-jupyter-packaging = "0.12.0" PREFERRED_VERSION_nodejs = "18.18.2" PREFERRED_VERSION_python3-wrapt = "1.16.0" +PREFERRED_VERSION_vulkan-tools = "1.2.182.0" +PREFERRED_VERSION_vulkan-headers = "1.2.182.0" +PREFERRED_VERSION_vulkan-loader = "1.2.182.0" diff --git a/layers/meta-opentrons/recipes-robot/opentrons-robot-app/opentrons-robot-app.bb b/layers/meta-opentrons/recipes-robot/opentrons-robot-app/opentrons-robot-app.bb index b21d1460..16f593dc 100644 --- a/layers/meta-opentrons/recipes-robot/opentrons-robot-app/opentrons-robot-app.bb +++ b/layers/meta-opentrons/recipes-robot/opentrons-robot-app/opentrons-robot-app.bb @@ -58,14 +58,19 @@ fakeroot do_install(){ # really system utilities and (in the case of wayland) actually can break # communication with the system because it uses a weird RPC thing and # really needs to get the system version. So we remove the local versions. + # however, chrome for some reason opens these libraries via direct calls + # or has a strict rpath or something so we need to symlink them explicitly rm ${DESTDIR}/libEGL.so ${DESTDIR}/libGLESv2.so ${DESTDIR}/libvulkan.so.1 + ln -s /usr/lib/libEGL.so ${DESTDIR}/libEGL.so + ln -s /usr/lib/libGLESv2.so ${DESTDIR}/libGLESv2.so + ln -s /usr/lib/libvulkan.so.1 ${DESTDIR}/libvulkan.so.1 } REQUIRED_DISTRO_FEATURES = "x11" do_install[depends] += "virtual/fakeroot-native:do_populate_sysroot" -INSANE_SKIP:${PN} = " already-stripped file-rdeps" +INSANE_SKIP:${PN} = " already-stripped file-rdeps dev-so " FILES:${PN} = "/opt/opentrons-app/* /opt/opentrons-app/**/*" # todo figure out how to not need cups RDEPENDS:${PN} = "udev \ @@ -76,5 +81,7 @@ RDEPENDS:${PN} = "udev \ libxcomposite libx11 libxrender libxext libx11-xcb libxi \ libxtst libxcursor libxrandr libxscrnsaver \ atk at-spi2-atk\ - cups" + cups \ + vulkan-loader vulkan-tools \ + " DEPENDS = " nodejs-native udev openssl-native " diff --git a/layers/meta-opentrons/recipes-robot/opentrons-robot-app/robot-app-wayland-launch_1.0.bb b/layers/meta-opentrons/recipes-robot/opentrons-robot-app/robot-app-wayland-launch_1.0.bb index 4b194c00..99609af6 100644 --- a/layers/meta-opentrons/recipes-robot/opentrons-robot-app/robot-app-wayland-launch_1.0.bb +++ b/layers/meta-opentrons/recipes-robot/opentrons-robot-app/robot-app-wayland-launch_1.0.bb @@ -23,9 +23,21 @@ SRC_URI = " \ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" -APPLICATION_ENVIRONMENT := '\"DISPLAY=\:0\:0\" \"XDG_SESSION_TYPE=wayland\" \"XDG_SESSION_DESKTOP=kiosk\" \"PYTHONPATH=/opt/opentrons-robot-server\"' +APPLICATION_ENVIRONMENT := '\"WAYLAND_DISPLAY=wayland-0\" \"XDG_RUNTIME_DIR=/run/user/0\" \"DISPLAY=\:0\:0\" \"XDG_SESSION_TYPE=wayland\" \"XDG_SESSION_DESKTOP=kiosk\" \"PYTHONPATH=/opt/opentrons-robot-server\"' -WAYLAND_APPLICATION := "/opt/opentrons-app/opentrons --disable-gpu --remote-debugging-port=9222 --discovery.candidates=localhost --discovery.ipFilter=\"127.0.0.1\" --isOnDevice=1 --no-sandbox --enable-features=UseOzonePlatform --ozone-platform=wayland --in-process-gpu --python.pathToPythonOverride=/usr/bin/python3" +WAYLAND_APPLICATION := "/opt/opentrons-app/opentrons \ + --disable-gpu \ + --remote-allow-origin=* \ + --remote-debugging-port=9222 \ + --discovery.candidates=localhost \ + --discovery.ipFilter=\"127.0.0.1\" \ + --isOnDevice=1 \ + --no-sandbox \ + --enable-features=UseOzonePlatform \ + --ozone-platform=wayland \ + --in-process-gpu \ + --python.pathToPythonOverride=/usr/bin/python3\ + " do_compile () { sed -e "s:@@wayland-application@@:${WAYLAND_APPLICATION}:" -e "s:@@initial-path@@:${INITIAL_PATH}:" opentrons-robot-app.sh.in > opentrons-robot-app.sh