Skip to content

Commit

Permalink
update repo's configs for Electron 9 / node 12
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
marcdumais-work committed Aug 3, 2020
1 parent 4df221c commit 052d5e3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .gitpod.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion browser-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions electron-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 052d5e3

Please sign in to comment.