Hello,
I am writing a snap to run an Electron HTML using Wayland. I was able to get it to work on my personal computer running Ubuntu and inside the VM of Ubuntu Core.
I followed the official tutorials such as this one - https://discourse.ubuntu.com/t/make-a-html5-electron-based-kiosk-snap/13992
I am trying to run my snap on a Raspberry Pi however, and it’s failing to start with a lot of different error logs. I must be missing something in the build process to use ARM binaries, but I can’t seem to find the answer anywhere for this.
Here are the logs I get when my snap is installed and running on the Raspberry Pi:
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: realpath: '': No such file or directory
May 22 20:43:21 localhost audit[3715]: AVC apparmor="DENIED" operation="rmdir" profile="snap.mysnap.daemon" name="/root/snap/mysnap/x1/" pid=3715 comm="rmdir" requested_mask="d" denied_mask="d" fsuid=0 oui
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: realpath: '': No such file or directory
May 22 20:43:21 localhost audit[3717]: AVC apparmor="DENIED" operation="rmdir" profile="snap.mysnap.daemon" name="/root/snap/mysnap/x1/" pid=3717 comm="rmdir" requested_mask="d" denied_mask="d" fsuid=0 oui
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: realpath: '': No such file or directory
May 22 20:43:21 localhost audit[3719]: AVC apparmor="DENIED" operation="rmdir" profile="snap.mysnap.daemon" name="/root/snap/mysnap/x1/" pid=3719 comm="rmdir" requested_mask="d" denied_mask="d" fsuid=0 oui
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: /snap/mysnap/x1/bin/desktop-launch: line 10: /snap/mysnap/x1/usr/bin/update-mime-database: cannot execute binary file: Exec format error
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: /snap/mysnap/x1/bin/desktop-launch: line 10: /snap/mysnap/x1/usr/lib/arm-linux-gnueabihf/libgtk-3-0/gtk-query-immodules-3.0: No such file or directory
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: update-mime-database /root/snap/mysnap/x1/.local/share/mime exited abnormally with status 126
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: /snap/mysnap/x1/usr/lib/arm-linux-gnueabihf/libgtk-3-0/gtk-query-immodules-3.0 exited abnormally with status 127
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost audit[3740]: AVC apparmor="DENIED" operation="open" profile="snap.mysnap.daemon" name="/var/cache/fontconfig/" pid=3740 comm="ls" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
May 22 20:43:21 localhost mysnap.daemon[3618]: ##################################################################################
May 22 20:43:21 localhost mysnap.daemon[3618]: If you are experiencing problems with your GUI app (e.g. bad fonts), please run:
May 22 20:43:21 localhost mysnap.daemon[3618]: snap connect mysnap:x11-plug mysnap:x11
May 22 20:43:21 localhost mysnap.daemon[3618]: ##################################################################################
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:21 localhost mysnap.daemon[3618]: /snap/mysnap/x1/bin/xwayland-kiosk-launch: line 135: /snap/mysnap/x1/usr/bin/Xwayland: cannot execute binary file: Exec format error
May 22 20:43:22 localhost mysnap.daemon[3618]: ERROR: ld.so: object '/snap/mysnap/x1/lib/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
May 22 20:43:22 localhost mysnap.daemon[3618]: /snap/mysnap/x1/bin/xwayland-kiosk-launch: line 148: /snap/mysnap/x1/usr/bin/i3: cannot execute binary file: Exec format error
May 22 20:43:22 localhost mysnap.daemon[3618]: /snap/mysnap/x1/player/kiosk: error while loading shared libraries: libX11.so.6: wrong ELF class: ELFCLASS64
May 22 20:43:22 localhost systemd[1]: snap.mysnap.daemon.service: Service hold-off time over, scheduling restart.
May 22 20:43:22 localhost systemd[1]: snap.mysnap.daemon.service: Scheduled restart job, restart counter is at 10.
May 22 20:43:22 localhost systemd[1]: Stopped Service for snap application mysnap.daemon.
May 22 20:43:22 localhost systemd[1]: snap.mysnap.daemon.service: Start request repeated too quickly.
May 22 20:43:22 localhost systemd[1]: snap.mysnap.daemon.service: Failed with result 'start-limit-hit'.
May 22 20:43:22 localhost systemd[1]: Failed to start Service for snap application mysnap.daemon.
May 22 20:44:06 localhost sudo[3784]: myuser : TTY=pts/0 ; PWD=/home/myuser ; USER=root ; COMMAND=/bin/journalctl -e
May 22 20:44:06 localhost sudo[3784]: pam_unix(sudo:session): session opened for user root by myuser(uid=0)
I am running “snapcraft --target-arch armhf” to build the snap, as well as
architectures:
- build-on: amd64
run-on: armhf
inside of my snapcraft.yaml as can be seen below:
name: mysnap
version: "0.1"
summary: Kiosk app
description: |
Kiosk app
base: core18
architectures:
- build-on: amd64
run-on: armhf
# architectures: [armhf]
confinement: strict
grade: devel
apps:
mysnap:
command: desktop-launch xwayland-kiosk-launch "$SNAP/player/kiosk" "--no-sandbox"
daemon:
daemon: simple
restart-condition: always
command: desktop-launch xwayland-kiosk-launch "$SNAP/player/kiosk" "--no-sandbox"
environment:
XWAYLAND_FULLSCREEN_WINDOW_HINT: window_role="browser-window"
plugs:
browser-support:
network:
network-bind:
opengl:
pulseaudio:
wayland:
parts:
player:
plugin: nodejs
nodejs-version: "12.13.1"
source: .
after: [desktop-gtk3, xwayland-kiosk-helper]
override-build: |
set -ex
case $SNAPCRAFT_ARCH_TRIPLET in
"i386-linux-gnu") ARCH="ia32";;
"x86_64-linux-gnu") ARCH="x64";;
"arm-linux-gnueabihf") ARCH="armv7l";;
"aarch64-linux-gnu") ARCH="arm64";;
*) echo "ERROR: electron does not support the '$SNAPCRAFT_ARCH_TRIPLET' architecture" && exit 1;;
esac
ARCH="armv7l"
apt-get update
apt-get install -y curl unzip
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
apt-get update
apt-get install -y nodejs
npm install --production
./node_modules/.bin/electron-packager . --overwrite --platform=linux --arch=$ARCH --output=release-build --prune=true
cp -R ./kiosk-linux-$ARCH $SNAPCRAFT_PART_INSTALL/player
stage-packages:
- libasound2
- libgconf-2-4
- libnss3
- libx11-xcb1
- libxss1
- libxtst6
# build-packages:
# - nodejs
# - npm
# - unzip
desktop-gtk3:
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
source-subdir: gtk
plugin: make
make-parameters: ["FLAVOR=gtk3"]
build-packages:
- build-essential
- libgtk-3-dev
stage-packages:
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libgtk-3-0
- libgdk-pixbuf2.0-0
- libglib2.0-bin
- libgtk-3-bin
- unity-gtk3-module
- libappindicator3-1
- locales-all
- xdg-user-dirs
- ibus-gtk3
- libibus-1.0-5
xwayland-kiosk-helper:
plugin: cmake
source: https://github.com/MirServer/xwayland-kiosk-helper.git
build-packages: [build-essential]
stage-packages: [xwayland, i3, libegl1-mesa, libgl1-mesa-glx]
Please let me know if anyone has any ideas as to why it could be failing.
Thank you,
Dima