From 052d5e365f9441e0b6ff69d4c112700ce833b309 Mon Sep 17 00:00:00 2001 From: Marc Dumais Date: Thu, 30 Jul 2020 17:43:04 -0400 Subject: [PATCH] update repo's configs for Electron 9 / node 12 Fixes #106 A few little tweaks are necessary to accommodate the new Electron and node versions. ATM the Electron example app fails at runtime when running on Gitpod, because of a missing a dynamic library: /workspace/theia-trace-extension/node_modules/electron/dist/electron: error while loading shared libraries: libgbm.so.1: cannot We need to update the Gitpod config so the dockerfile used for this repoi will contain a new Ubuntu package, required for Electron 9. This config file originally came from the main Theia repo, and the updated version is the same. See LICENSE.gitpod.md for more details. Here's where the --no-sandbox idea came from - it permits the Electron version of the example app to start in Gitpod: eclipse-theia/theia#7968 (comment) Also, for the Electron version of the example application to work correctly in Gitpod (potentially in any container-based environment), it's required to use the "--ignore-gpu-blacklist" startup paramter. Signed-off-by: Marc Dumais --- .gitpod.dockerfile | 5 ++--- .gitpod.yml | 2 +- browser-app/package.json | 2 +- electron-app/package.json | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile index 18ed99173..9197f275f 100644 --- a/.gitpod.dockerfile +++ b/.gitpod.dockerfile @@ -8,13 +8,12 @@ RUN sudo apt-get update \ # window manager && sudo apt-get install -y jwm \ # electron - && sudo apt-get install -y libgtk-3-0 libnss3 libasound2 \ + && sudo apt-get install -y libgtk-3-0 libnss3 libasound2 libgbm1 \ # native-keymap && sudo apt-get install -y libx11-dev libxkbfile-dev \ && sudo rm -rf /var/lib/apt/lists/* -# Pin Node.js to v10. -ENV NODE_VERSION="10.21.0" +ENV NODE_VERSION="12.14.1" RUN bash -c ". .nvm/nvm.sh \ && nvm install $NODE_VERSION \ && nvm use $NODE_VERSION \ diff --git a/.gitpod.yml b/.gitpod.yml index 1ce77789f..7d316448e 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -21,7 +21,7 @@ tasks: yarn download:sample-traces && yarn command: > - yarn start:electron ../TraceCompassTutorialTraces/ --hostname=0.0.0.0 + yarn start:electron ../TraceCompassTutorialTraces/ --hostname=0.0.0.0 --ignore-gpu-blacklist --no-sandbox github: prebuilds: pullRequestsFromForks: true \ No newline at end of file diff --git a/browser-app/package.json b/browser-app/package.json index 41668f6b5..b3f58e1c3 100644 --- a/browser-app/package.json +++ b/browser-app/package.json @@ -42,7 +42,7 @@ "download:plugins": "theia download:plugins -p=true" }, "engines": { - "node": ">=10.2.0 < 12" + "node": ">=10.2.0 < 13" }, "theiaPluginsDir": "plugins", "theiaPlugins": { diff --git a/electron-app/package.json b/electron-app/package.json index ece4a48ee..e75a54f0e 100644 --- a/electron-app/package.json +++ b/electron-app/package.json @@ -3,7 +3,7 @@ "name": "electron-theia-trace-example-app", "main": "scripts/theia-trace-main.js", "build": { - "electronVersion": "4.2.12" + "electronVersion": "9.1.2" }, "version": "0.0.1", "theia": { @@ -54,7 +54,7 @@ "download:plugins": "theia download:plugins -p=true" }, "engines": { - "node": ">=10.2.0 < 12" + "node": ">=10.2.0 < 13" }, "repository": { "type": "git",