question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build snap for armhf on amd64

See original GitHub issue
  • Version: 20.44.1
  • Target: armv7l

Thanks for that last fix! I tried building the snap for armv7l with the newest update and now it just hangs. I’m trying to build the snap on my amd64 ubuntu machine – so I’m not sure if cross compilation is working yet?

I’m running this command: build --linux --armv7l snap

Which results in it hanging here:

alt text

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:28 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
develarcommented, Jul 1, 2019

Works for me. I will release template (so, you can build your app on any OS) tomorrow.

1reaction
ZaneLcommented, Jun 29, 2019

I’ve returned with some info on how to build snaps for armhf (raspberry pi) + arm64. I assume things will change in the near future to make this easier, but at the moment there are two problems:

1.) Cross compilation is only kinda-sorta working in snapcraft at the moment…so it doesn’t seem possible to build an armhf snap on an amd64 system without some bizarre problems – especially an electron snap.

2.) As a result of this, you need to build the snaps locally on your raspberry pi. The issue is that you can’t do this easily since multipass won’t run on ubuntu server, ubuntu mate (or any standard linux OS) since virtualization (KVM) is typically disabled for arm systems in the kernel.

Temporary solution:

One thing I’ve tried that worked is as follows:

1.) Setup your electron app with the newest version of electron-builder on your raspberry pi and attempt to build the snap. It will fail (because KVM is disabled and it can’t launch multipass), but it will spit out a folder in the dist directory that looks like __snap-arm64

2.) Install lxd

2.) cd into that __snap folder and enter the following commands (obviously these will change a bit depending on armhf/arm64 and your app name):

lxc launch ubuntu:18.04 mysnapcraft
lxc file push -r . mysnapcraft/home/ubuntu/
lxc exec mysnapcraft -- /bin/bash 
snap install snapcraft --classic
cd /home/ubuntu/__snap-arm64
snapcraft --destructive-mode
exit
lxc file pull mysnapcraft/home/ubuntu/__snap-arm64/electron-quick-start_1.0.0_arm64.snap .

You should now have the snap in your __snap-arm64 folder.

What you’ve done here is created a container, copied the electron project and snap files into the container, installed snapcraft in the container, and run snapcraft in destructive mode to build everything without using multipass. Then the last command copies the snap file that you’ve built back out of the container.

Still not working

So all of this works fine and the electron app installs and connects the various interfaces, but when running the app it throws this error:

error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cross compile snap on amd64 to arm - Snapcraft forum
Hello, I've a snap for arm and building it with snapcraft (classic ubuntu) on a rpi (arm) is working absolutely fine.
Read more >
Armhf snap builds for raspberry pi - Rocket Chat forums
We use a build service from Canonical on launchpad. They use arm64 workers and use lxd to emulate armhf. My suspicion is some...
Read more >
snapcraft/xenial-armhf - Docker Image
This image includes toolchains and Snapcraft to help app and hardware enablement engineers to build a snap software package and Ubuntu Core image...
Read more >
Building a gadget snap - Ubuntu Core docs
In the following example, we build for armhf from an amd64 host. Prerequisites. An Ubuntu host (20.04 or newer is recommended); Snapcraft. First,...
Read more >
Snapcraft Packages (snaps) - GoReleaser
Defaults to all builds. builds: - foo - bar # You can change the name of the ... SNAP_ARCH: the architecture of device...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found