Hey y’all,
I’m trying to figure out how to build an armhf version of a Python snap (since, ya know, cross compilation isn’t implemented for Python). So I spun up a Raspbian image on QEMU, but when I went to install snapcraft, I got this error.
pi@raspberrypi:~ $ sudo snap install snapcraft
error: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount:
/tmp/sanity-mountpoint-511874327: unknown filesystem type 'squashfs'.
the lxd container is a fully fledged classic ubuntu with full snap support, no limits here …
fabrica only builds for the used host architecture currently (it does just the git checkout and runs snapcraft in the tree inside an lxd container, similar to what i described as manual process above)
EDIT: argh … sorry … i didnt really get that you are not actually using a pi the qemu pi emulation is rather a joke … i wouldnt bother with it and invest the 25€ to buy an actual pi2 or 3
Oh, I think you misunderstand, I’m emulating because I don’t have an ARM board to build with. That’s why I’m not using ubuntu, because I couldn’t figure out how to get an armhf version of it to run on QEMU.
Well, then my best recommendation still stands … get a Pi4 … a good USB 3.1 SSD (sandisk extreme shows very good results here) and use snapcraft (or fabrica) as i described above … cross building with snapcraft is possible (i do it all day for kernels and gadgets) but as soon as you have anything that requires dependencies it gets extremely painful
also note that the slowest pi will still be 10x faster and 10x more reliable than using any of the qemu armhf VMs available …
Hello @willnilges sorry for jumping late actually i got notification summary in my mail, I had worked on ubuntu core some time ago & i had similar issue to build snaps for armhf snap, As @ogra suggested for native build (build on host) we should good to go with Pi or similar SOC having armhf architecture.
I was having Pi-3B+ board with 1Gb RAM where i was struggling with the speed to create kernel or gadget snap and SOC also got heated.
At that time i had done some workaround for this issue may be this will help -
I used docker concept here, i have pulled armv7/armhf-ubuntu(Xenial) image from docker hub.
Attaching docker file for your help -
FROM armv7/armhf-ubuntu:xenial
COPY qemu-arm-static /usr/bin/
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN apt-get -y update && apt-get -y install --fix-missing
RUN apt-get -y update && apt-get -y install wget git build-essential python3-pip
RUN apt-get -y install snapcraft
RUN apt-get -y install sudo
CMD ["/bin/bash"]
Once image is install run the container with volumes( sharedir b/w docker container and host machine: ubuntu 18.04 LTS )
this will sadly give you a completely outdated snapcraft (which is why i never propose the qemu-user-static package (that package ships a qemu-debootstrap command btw, using that saves you from the extra “cp qemu-arm-static …” command you are doing above))
snaps can not run in chroots, so you can not use the latests snapcraft (iirc 18.04 is somewhere at 2.x while the snap is right now at 4.0) and will be missing features/have to have incompatible snapcraft.yaml’s …
@ogra diverting from the main topic, i have one query actually i am facing an issue when i try to install an application snap in Ubuntu classic, i shipped this application snap in the server image and try to install this from rc.local file.
But it through an error that unable to install snap due to bad permission, contact developer where as same is successfully installed manually.
May me you can point me any docs and any idea to figure out the real root causes.