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:
Issue Analytics
- State:
- Created 4 years ago
- Comments:28 (12 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Works for me. I will release template (so, you can build your app on any OS) tomorrow.
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):
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