On an armhf system ? (looks like you compiled the snap on the wrong architecture βExec format errorβ is typically a sign for this)
No, Iβm using an ubuntu machine, which is running ubuntu 20.04, to build the snap. So, the snapcraft command is executed on amd64 system. Once the snap is build, it is installed in the RPi 3, where the errors are occurring.
In order to be able to build and armhf snap I had to include the section bellow on snapcraft.ymal file:
architectures:
- build-on: amd64
run-on: armhf
this wont work if not all your code is also designed for cross compilation and if you dont use a cross compiler/toolchain β¦
else you just end up with x86 binaries inside a snap with armhf naming (which then results in exec format errors)
use snapcraft.io/build or build natively on your pi:
https://ograblog.wordpress.com/2020/07/10/building-snap-packages-on-ubuntu-core/
Thanks @ogra for your tips. It seems that I gave a little step further β¦ but the snap build failed.
After removing the architectures section from the initial yaml file. I tried to build the snap on snapcraft.io/build. (I tried the snapcraft remote build approach as well, and problems were exactly the same.)
Part of the build log is here:
WARN engine electron-notarize@1.0.0: wanted: {"node":">= 10.0.0"} (current: {"node":"8.10.0","npm":"3.5.2"})
WARN engine asar@3.0.3: wanted: {"node":">=10.12.0"} (current: {"node":"8.10.0","npm":"3.5.2"})
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8810 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
npm ERR! Linux 4.15.0-109-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--unsafe-perm=true" "electron" "electron-packager"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG
npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror <http://github.com/npm/npm/issues>
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 38633 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7063 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6753 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 10257 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7525 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 30808 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 14286 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 14872 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 21870 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 101394 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 26640 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 770198 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
npm ERR! Please include the following file with any support request:
npm ERR! /build/jbtest/parts/electron-helloworld/build/npm-debug.log
cp: cannot stat './electron-quick-start-linux-armv7l': No such file or directory
Failed to run 'override-build': Exit code was 1.
Build failed
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 258, in run
self.build()
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 247, in build
env=env)
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 100, in run_build_command
return self.backend.run(args, env=full_env, **kwargs)
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/lxd.py", line 537, in run
subprocess.check_call(cmd, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['lxc', 'exec', 'lp-bionic-armhf', '--env', 'LANG=C.UTF-8', '--env', 'SHELL=/bin/sh', '--env', 'SNAPCRAFT_BUILD_INFO=1', '--env', 'SNAPCRAFT_IMAGE_INFO={"build-request-id": "lp-59239513", "build-request-timestamp": "2020-09-17T14:47:23Z", "build_url": "https://launchpad.net/~build.snapcraft.io/+snap/9ba49fc2fc7fef99b475d95896907e3d/+build/1120242"}', '--env', 'SNAPCRAFT_BUILD_ENVIRONMENT=host', '--env', 'http_proxy=http://10.10.10.1:8222/', '--env', 'https_proxy=http://10.10.10.1:8222/', '--env', 'GIT_PROXY_COMMAND=/usr/local/bin/snap-git-proxy', '--', '/bin/sh', '-c', 'cd /build/jbtest && linux32 snapcraft']' returned non-zero exit status 2
Revoking proxy token...
RUN: /usr/share/launchpad-buildd/bin/in-target scan-for-processes --backend=lxd --series=bionic --arch=armhf SNAPBUILD-1120242
Scanning for processes to kill in build SNAPBUILD-1120242
Any tip regarding these error messages? It seems to be related with node versionβ¦
I remember that Iβm trying to complete an example on a RPi3. So I wasnβt expecting to face these problems.
Thanks
Note: For those of you who are following this thread and wondering what snapcraft remote build is, my suggestion is having a look to these links:
@ joao.belo did you manage to build the snap? I am trying to acheave something similar but with electron-cgi. I am just on the first stage and snapcraft is killing me
Hi @fairking, unfortunately not yet β¦
This time I followed the last @ogra suggestions, so I included the workaround lines.
# workaround for build.snapcraft.io builds
# https://bugs.launchpad.net/bugs/1886861
if [ -n "$http_proxy" ]; then
export ELECTRON_GET_USE_PROXY=1
export GLOBAL_AGENT_HTTP_PROXY="${http_proxy}"
export GLOBAL_AGENT_HTTPS_PROXY="${http_proxy}"
fi
which only per si doesnβt not solved the problem. I also had a deeper look into this yaml file and this link, so I also set the nodejs-version) and nodejs-package.manager properties (in electron-helloworld part).
nodejs-version: 12.18.2
nodejs-package-manager: npm
But still, the build is not successful in any architecture.
The errors that I got this time were:
[18/Sep/2020:14:13:26 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 38058 "install" "npm/3.5.2 node/v8.10.0 linux arm"
WARN engine type-fest@0.13.1: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"3.5.2"})
[18/Sep/2020:14:13:26 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 35613 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:27 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6563 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:27 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7912 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:27 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7249 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:27 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 34576 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:27 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 11289 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:27 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7680 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:27 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 13876 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:28 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 323886 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:28 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 11152 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:28 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 11236 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:29 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 10474 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:29 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7513 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:29 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 5804 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:29 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8336 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:29 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6515 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:29 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8339 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7582 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 12343 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 10514 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6758 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 11677 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6252 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 13957 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 29719 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8192 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 20889 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 20598 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:30 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6384 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 5868 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8475 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7236 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6284 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6287 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7886 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 5988 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 15244 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 10384 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7063 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:31 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 12764 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:32 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6881 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:32 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7901 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:32 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 16498 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:32 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8805 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:32 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 17348 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:32 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7903 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:32 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 21238 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:32 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 5959 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:33 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 9614 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:33 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6611 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:33 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 15569 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:33 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6699 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:33 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 9749 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:33 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8993 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:34 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7658 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:34 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 9731 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:34 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6959 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:34 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6807 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:34 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6370 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:35 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 5810 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:35 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6067 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:36 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7698 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:36 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7103 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:36 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8163 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:37 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6079 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:37 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 5969 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:38 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6654 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:38 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6136 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:39 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6612 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:39 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 18248 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:39 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 12302 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:39 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 4268 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:39 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 19387 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:40 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7438 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:40 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8252 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:40 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 21221 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:40 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 23465 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:40 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8058 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:40 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8465 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:40 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6097 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:40 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 34268 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:41 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6451 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:41 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6711 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:41 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 11987 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:41 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 30603 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:41 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 16405 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:41 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7416 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:41 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 9863 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:41 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8090 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:41 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 5412 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:41 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6283 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:42 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6045 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:42 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6412 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:42 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 14386 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:42 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 9308 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:42 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 11523 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:42 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6666 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:42 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 4268 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:43 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7288 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:43 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 16108 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:44 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 12786 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:44 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 9631 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:44 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7639 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:44 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8615 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:44 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 12051 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:45 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 5929 "install" "npm/3.5.2 node/v8.10.0 linux arm"
[18/Sep/2020:14:13:45 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6729 "install" "npm/3.5.2 node/v8.10.0 linux arm"
> core-js@3.6.5 postinstall /build/jbtest/parts/electron-helloworld/build/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> electron@10.1.2 postinstall /build/jbtest/parts/electron-helloworld/build/node_modules/electron
> node install.js
[18/Sep/2020:14:13:57 +0000] "CONNECT github.com:443 HTTP/1.1" 200 7040 "-" "-"
[18/Sep/2020:14:14:32 +0000] "CONNECT github-production-release-asset-2e65be.s3.amazonaws.com:443 HTTP/1.1" 200 65083955 "-" "-"
[18/Sep/2020:14:14:32 +0000] "CONNECT github.com:443 HTTP/1.1" 200 7005 "-" "-"
[18/Sep/2020:14:14:33 +0000] "CONNECT github-production-release-asset-2e65be.s3.amazonaws.com:443 HTTP/1.1" 200 9993 "-" "-"
electron-quick-start@1.0.0 /build/jbtest/parts/electron-helloworld/build
βββ¬ electron@10.1.2
βββ¬ @electron/get@1.12.2
β βββ¬ debug@4.1.1
β β βββ ms@2.1.2
β βββ env-paths@2.2.0
β βββ¬ fs-extra@8.1.0
β β βββ graceful-fs@4.2.4
β β βββ jsonfile@4.0.0
β β βββ universalify@0.1.2
β βββ¬ global-agent@2.1.12
β β βββ boolean@3.0.1
β β βββ core-js@3.6.5
β β βββ es6-error@4.1.1
β β βββ¬ matcher@3.0.0
β β β βββ escape-string-regexp@4.0.0
β β βββ¬ roarr@2.15.4
β β β βββ detect-node@2.0.4
β β β βββ¬ globalthis@1.0.1
β β β β βββ¬ define-properties@1.1.3
β β β β βββ object-keys@1.1.1
β β β βββ json-stringify-safe@5.0.1
β β β βββ semver-compare@1.0.0
β β β βββ sprintf-js@1.1.2
β β βββ semver@7.3.2
β β βββ¬ serialize-error@7.0.1
β β βββ type-fest@0.13.1
β βββ¬ global-tunnel-ng@2.7.1
β β βββ encodeurl@1.0.2
β β βββ lodash@4.17.20
β β βββ¬ npm-conf@1.1.3
β β β βββ¬ config-chain@1.1.12
β β β β βββ ini@1.3.5
β β β β βββ proto-list@1.2.4
β β β βββ pify@3.0.0
β β βββ tunnel@0.0.6
β βββ¬ got@9.6.0
β β βββ @sindresorhus/is@0.14.0
β β βββ¬ @szmarczak/http-timer@1.1.2
β β β βββ defer-to-connect@1.1.3
β β βββ¬ cacheable-request@6.1.0
β β β βββ clone-response@1.0.2
β β β βββ get-stream@5.2.0
β β β βββ http-cache-semantics@4.1.0
β β β βββ¬ keyv@3.1.0
β β β β βββ json-buffer@3.0.0
β β β βββ lowercase-keys@2.0.0
β β β βββ normalize-url@4.5.0
β β β βββ responselike@1.0.2
β β βββ decompress-response@3.3.0
β β βββ duplexer3@0.1.4
β β βββ¬ get-stream@4.1.0
β β β βββ¬ pump@3.0.0
β β β βββ end-of-stream@1.4.4
β β β βββ¬ once@1.4.0
β β β βββ wrappy@1.0.2
β β βββ lowercase-keys@1.0.1
β β βββ mimic-response@1.0.1
β β βββ p-cancelable@1.1.0
β β βββ to-readable-stream@1.0.0
β β βββ¬ url-parse-lax@3.0.0
β β βββ prepend-http@2.0.0
β βββ progress@2.0.3
β βββ¬ sanitize-filename@1.6.3
β β βββ¬ truncate-utf8-bytes@1.0.2
β β βββ utf8-byte-length@1.0.4
β βββ sumchecker@3.0.1
βββ @types/node@12.12.62
βββ¬ extract-zip@1.7.0
βββ¬ concat-stream@1.6.2
β βββ buffer-from@1.1.1
β βββ inherits@2.0.4
β βββ¬ readable-stream@2.3.7
β β βββ core-util-is@1.0.2
β β βββ isarray@1.0.0
β β βββ process-nextick-args@2.0.1
β β βββ safe-buffer@5.1.2
β β βββ string_decoder@1.1.1
β β βββ util-deprecate@1.0.2
β βββ typedarray@0.0.6
βββ¬ debug@2.6.9
β βββ ms@2.0.0
βββ¬ mkdirp@0.5.5
β βββ minimist@1.2.5
βββ¬ yauzl@2.10.0
βββ buffer-crc32@0.2.13
βββ¬ fd-slicer@1.1.0
βββ pend@1.2.0
Usage: npm <command>
where <command> is one of:
access, add-user, adduser, apihelp, author, bin, bugs, c,
cache, completion, config, ddp, dedupe, deprecate, dist-tag,
dist-tags, docs, edit, explore, faq, find, find-dupes, get,
help, help-search, home, i, info, init, install,
install-test, issues, it, la, link, list, ll, ln, login,
logout, ls, outdated, owner, pack, ping, prefix, prune,
publish, r, rb, rebuild, remove, repo, restart, rm, root,
run-script, s, se, search, set, show, shrinkwrap, star,
stars, start, stop, t, tag, team, test, tst, un, uninstall,
unlink, unpublish, unstar, up, update, upgrade, v, verison,
version, view, whoami
npm <cmd> -h quick help on <cmd>
npm -l display full usage info
npm faq commonly asked questions
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/root/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@3.5.2 /usr/share/npm
Failed to run 'override-build': Exit code was 1.
Build failed
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 258, in run
self.build()
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 247, in build
env=env)
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 100, in run_build_command
return self.backend.run(args, env=full_env, **kwargs)
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/lxd.py", line 537, in run
subprocess.check_call(cmd, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['lxc', 'exec', 'lp-bionic-armhf', '--env', 'LANG=C.UTF-8', '--env', 'SHELL=/bin/sh', '--env', 'SNAPCRAFT_BUILD_INFO=1', '--env', 'SNAPCRAFT_IMAGE_INFO={"build-request-id": "lp-59256206", "build-request-timestamp": "2020-09-18T13:58:12Z", "build_url": "https://launchpad.net/~build.snapcraft.io/+snap/9ba49fc2fc7fef99b475d95896907e3d/+build/1121621"}', '--env', 'SNAPCRAFT_BUILD_ENVIRONMENT=host', '--env', 'http_proxy=http://10.10.10.1:8222/', '--env', 'https_proxy=http://10.10.10.1:8222/', '--env', 'GIT_PROXY_COMMAND=/usr/local/bin/snap-git-proxy', '--', '/bin/sh', '-c', 'cd /build/jbtest && linux32 snapcraft']' returned non-zero exit status 2
Revoking proxy token...
RUN: /usr/share/launchpad-buildd/bin/in-target scan-for-processes --backend=lxd --series=bionic --arch=armhf SNAPBUILD-1121621
Scanning for processes to kill in build SNAPBUILD-1121621
The snapcraft.yaml file that Iβm using to build the snap is available here, in case anyone wants to check. Following the commints you can track my buildβs attempt history. None of them have been succeeded.
The problem continues to be related with node version. Any tips about whatβs going on?
I believe the problem is due to electron-packager version not being pinned. v15.0.0 dropped support for node<10, which breaks the tutorial. The tutorial needs to be updated for sureβ¦
Hereβs a version I just built for armhf & aarch64, though untested:
Iβm going to refine that further and will update the tutorial accordingly.
Hi @cjp256, thanks for you help.
Iβve adapted my snapcraf.yaml using your as reference. I leave it here for those who are facing a similar problem and the build was successful, but although itβs successful there were some missing libraries log messages.
Priming desktop-gtk3
This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft:
- libgdk-x11-2.0.so.0
- libgtk-x11-2.0.so.0
These dependencies can be satisfied via additional parts or content sharing. Consider validating configured filesets if this dependency was built.
Priming electron-helloworld
The 'electron-helloworld' part is missing libraries that are not included in the snap or base. They can be satisfied by adding the following entries to the existing stage-packages for this part:
- libdrm2
- libgbm1
- libwayland-server0
- libxcb-dri3-0
To remove these messages from build log, Iβve updated some of the yaml file section this way:
...
parts:
electron-helloworld:
...
stage-packages:
...
- libdrm2
- libgbm1
- libwayland-server0
- libxcb-dri3-0
...
desktop-gtk3:
...
stage-packages:
...
- libgtk2.0-0
After rebuilding the snap the previous messages disappeared.
I havenβt had opportunity to install and test the snap, yet. But I will do it and as soon as I have more details I let you know.
Hi @cjp256, I was looking through the βkioskβ tutorials following some improvements to the support for X11 in kiosk environments.
I see that youβve been planning to update the tutorial and, as Iβve no knowledge of nodejs
(yet) will happily let you fix that up if thatβs imminent. How is it going?
Excellent!
I couldnβt get the tutorial working at all. There are some critical pieces that I think are missing (mir-kiosk snap isnβt mentioned, for example).
Here are the logs for my latest attempt which mostly matches the yaml found in the tutorial:
2020-10-09T11:29:20Z electron-hello-world-kiosk.daemon[10603]: Fatal server error:
2020-10-09T11:29:20Z electron-hello-world-kiosk.daemon[10603]: (EE) wl_display@1: error 2: no memory
2020-10-09T11:29:20Z electron-hello-world-kiosk.daemon[10603]: (EE)
2020-10-09T11:29:21Z electron-hello-world-kiosk.daemon[10603]: i3: Cannot open display
2020-10-09T11:29:21Z electron-hello-world-kiosk.daemon[10603]: The futex facility returned an unexpected error code./snap/electron-hello-world-kiosk/x1/bin/xwayland-kiosk-launch: line 151: 10815 Aborted "$@"
Beyond that, I experimented with trying to use gnome extension (probably terrible idea in an effort to have a more succinct YAML), and using command-chain for the launcher scripts.
With regards to the electron parts, here is a tidy example, though using the gnome extension: https://github.com/cjp256/electron-snap-examples/blob/master/electron-packager-hello-world/snapcraft.yaml
Itβs on my agenda to make an electron-packager plugin for core20 to further simplify that, but am waiting until thereβs a desktop option (for core20) to use it with.
FWIW, Iβm testing in the QEMU instance, launched with kvm -smp 4 -m 4096 -netdev user,id=mynet0,hostfwd=tcp::8022-:22,hostfwd=tcp::8090-:80 -device virtio-net-pci,netdev=mynet0 -vga qxl -drive file=ubuntu-core-18-amd64.img,format=raw
.
That doesnβt build for me:
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/3134/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> core-js@3.6.5 postinstall /root/parts/electron-quick-start/build/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> electron@10.1.3 postinstall /root/parts/electron-quick-start/build/node_modules/electron
> node install.js
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module '/var/lib/snapd/void/install.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@10.1.3 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@10.1.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-10-09T14_50_32_270Z-debug.log
Failed to run 'override-build': Exit code was 1.
Adding --scripts-prepend-node-path
to the npx
command suppresses first the warning, but otherwise doesnβt help.
[edit]
Googling got it building and running, but is this actually good?
parts:
electron-quick-start:
plugin: nil
source: https://github.com/electron/electron-quick-start.git
override-build: |
npm config set scripts-prepend-node-path true
npm install electron electron-packager --unsafe-perm=true
npx electron-packager . --overwrite --platform=linux --output=release-build --prune=true
cp -rv ./electron-quick-start-linux-* $SNAPCRAFT_PART_INSTALL/electron-quick-start
build-snaps:
- node/14/stable
build-packages:
- unzip
- libc6-dev
stage-packages:
- libnss3
- libnspr4
Are you using destructive mode by chance?
No, just the default multipass based build
if your build runs as root --unsafe-perm is a hard requirement of npm β¦ this can also be set as environment variable β¦ i have been wondering since a long time if we should not make that a default env setting for the nodejs plugin β¦
Ah yes, --unsafe-perm is required when using sudo, as in the case of multipass.
In the case of LXD I did not have issues. npm
is detecting use of sudo and changing itβs behavior accordingly. We can probably drop --unsafe-perm
as long we scrub SUDO_UID
and SUDO_GID
from Multipassβ command environment. At least a quick test showed that worked.
Iβve still got runtime errors to resolve (and some build cleanup) but thereβs a WIP branch here:
Thanks for the help - will get back to it next week.
[Update]
This morning Iβve got this mostly working on a Classic desktop. Except that on the first run after installation the app crashes. (Have yet to try on a Core system.)
@ogra, @cjp256, maybe someone a bit more familiar with electron development could take a look?
To reproduce on an X11 based desktop, install and run mir-kiosk
:
snap install mir-kiosk && mir-kiosk
Checkout, build, install and run from the above branch:
git clone --branch electron-example https://github.com/MirServer/mir_kiosk_x11-example.git
cd mir_kiosk_x11-example
snapcraft && snap install --dangerous *_amd64.snap && mir_kiosk_x11-example
This first run SEGFAULT
s, but does show a brief βflashβ on the βMir on X11β window.
Subsequent runs of mir_kiosk_x11-example
work as expected and display βHello worldβ on the βMir on X11β window.
ELECTRON_ENABLE_LOGGING=1
doesnβt show anything that seems related to the SEGFAULT, and I can delete both ~/snap/mir-kiosk-x11-example/current/*
and $XDG_RUNTIME_DIR/snap.mir-kiosk-x11-example/*
without getting the segfault.