Theia build on Raspbian hangs at `DeprecationWarning: Tapable.apply...`

Hi,

I’m trying to build Theia on Raspbian Buster on RPi 3B+ following the Theia build instructions on the homepage.
package.json is just core dependencies.

When I run yarn theia build, I get:
(node:1754) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
and then the build just hangs and crashes the Pi after a while.

Any ideas? Does the Pi not have enough memory to build Theia?

[original thread by BrotherCreamy]

and crashes the Pi

What’s the error?

Does the Pi not have enough memory to build Theia?

Not sure - it might be tight. How much memory do you have on the board? Anecdotally we seem to need 4GB to be able to consistently build some/most of our apps contained in Docker images. e.g.:https://github.com/theia-ide/theia-apps/blob/master/theia-full-docker/Dockerfile#L196

This previous thread might have interesting info: https://spectrum.chat/theia/general/has-anybody-had-any-success-with-building-theia-on-a-raspberry-pi-or-other-arm-device~c0db39f7-43a1-4edc-a8b0-788ec049edd4

[BrotherCreamy]

No error. The mouse becomes unresponsive and Pi requires a reboot.

[BrotherCreamy]

It’s a Pi 3B+, so 1GB of memory. Thanks Marc, I will check out the thread that you linked.

Yes, 1GB seems low. In the other thread youll find a link to an EclipseSource article about how to cross-compile from your PC - running a Theia browser application should work ok, even if building does not.

[BrotherCreamy]

Alright, I successfully managed to build Theia on RPi 3B+ (running Raspbian Buster) by increasing SWAP size to 2048.

It still sat on that DeprecationWarning line for about 5 minutes, but then built successfully, and I’m able to run Theia.

Thanks Marc! Thanks Akos!

Nice, thanks for the info! Can you build the electron app as well? I am curious about the native-keymap dependency (https://github.com/eclipse-theia/theia/issues/7432).

Since I had a Raspberry Pi 4B with 4GB RAM available, I tried building/running the Theia example application. I used default Raspbian and was nicely surprised on how much more like the vanilla Debian it is now vs let’s say ~5 years ago. Basically the build dependencies for Theia are installed just like on Ubuntu, and it works the same, just slower. My guess is that the microSD card is the bottleneck, with a speed of ~10MB/s.

The Electron example worked too, BTW.

[BrotherCreamy]

@marc-dumais Interesting. So I suppose the native-keymap dependency issue doesn’t happen with armv8 but only with armv7l?

@kittaakos
I just tried building the theia-hello-world-extension example, and got errors related to a native-keymap dependency when running yo theia-extension:

error /home/pi/theia-extension-example/theia-hello-world-extension/node_modules/native-keymap: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/pi/theia-extension-example/theia-hello-world-extension/node_modules/native-keymap
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@10.20.1 | linux | arm
gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [ '/home/pi/theia-extension-example/theia-hello-world-extension/node_modules/electron-rebuild/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/theia-extension-example/theia-hello-world-extension/node_modules/native-keymap/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/theia-extension-example/theia-hello-world-extension/node_modules/electron-rebuild/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/pi/.cache/node-gyp/10.20.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/pi/.cache/node-gyp/10.20.1',
gyp info spawn args   '-Dnode_gyp_dir=/home/pi/theia-extension-example/theia-hello-world-extension/node_modules/electron-rebuild/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/pi/.cache/node-gyp/10.20.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/pi/theia-extension-example/theia-hello-world-extension/node_modules/native-keymap',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Package xkbfile was not found in the pkg-config search path.
Perhaps you should add the directory containing `xkbfile.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xkbfile' found
gyp: Call to 'pkg-config x11 xkbfile --cflags | sed s/-I//g' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/pi/theia-extension-example/theia-hello-world-extension/node_modules/electron-rebuild/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.19.97-v7+
gyp ERR! command "/home/pi/.nvm/versions/node/v10.20.1/bin/node" "/home/pi/theia-extension-example/theia-hello-world-extension/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/theia-extension-example/theia-hello-world-extension/node_modules/native-keymap
gyp ERR! node -v v10.20.1

Does this sound like the same problem (or is it just because I’m a noob)?

1 Like

@brothercreamy

So I suppose the native-keymap dependency issue doesn’t happen with armv8 but only with armv7l?

Seems likely. As a sanity check, have you installed the following packages?
Debian-based: sudo apt-get install libx11-dev libxkbfile-dev

from this section: https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#prerequisites

@marcdumais-work
I hadn’t installed libxkbfile-dev as it turns out :man_facepalming:
It builds fine now, albeit on a new armv8 device (ODroid-N2), but I was getting the exact same errors on the RPi 3B+, so I guess it’s not related to the arm version?

@kittaakos
I also built and ran the theia-hello-world-extension Electron app on my armv8 device. Will try it on armv7l shortly.

1 Like

Thank you, @BrotherCreamy :+1:

@BrotherCreamy Cool! I have a question about your board: did you install the OS/Theia app on the eMMC storage? This looks quite a bit faster vs the micro-sd card I use on my Raspberry pi 4. I got the feeling that relatively slow storage IO may have been the bottleneck, when playing around.

I could build and run Theia on armv7l (Cortex-A72). I set the max_old_perm_size to 3000.

Hi! To find out what I can do, say @discobot display help.

Wow sorry for the late reply… I didn’t receive any notifications about your messages.

@kittaakos
I was also able to build the theia-hello-world-extension Electron app on my armv7l device. I didn’t have to change any other settings… it built just fine.
By the way, I’m having trouble finding any results online about max_old_perm_size… did you mean max_old_space_size?

@marcdumais-work
The OS/Theia app are installed on eMMC. Theia definitely builds faster, but I guess this is mostly down to having four times the RAM on the armv8 board… it’s hard to tell how much of a difference the eMMC storage makes.

1 Like

Yes. Thanks!