snapcraft cannot build snap by default on aarch64

Bug #2012074 reported by Guillaume Beuzeboc
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Confirmed
Undecided
Unassigned

Bug Description

On aarch64 architecture calling the snapcraft command without additional options doesn't work.

Indeed, snapcraft tries to launch a multipass instance based on the image snapcraft:core20. This image doesn't seem to exist on arm (not listed in `multipass list` on arm64 while listed on amd64)

To reproduce this behaviour on an aarch64 ubuntu:
sudo snap install snapcraft --classic
snapcraft init
snapcraft

Then we get this error:
Launching a VM.
warning: "--mem" long option will be deprecated in favour of "--memory" in a future release.Please update any scripts, etc.
launch failed: Unable to find an image matching "core20". Please use `multipass find` for supported remotes and images.
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.

snapcraft --version
snapcraft 7.3.1

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"

Revision history for this message
Callahan Kovacs (mr-cal) wrote :

Thanks for raising this!

I can confirm this behavior. The root cause is that Mulitpass's images for snapcraft are only available on amd64.

There are 2 parts to the solution:
1. craft-providers should give a more useful error message and link to documentation (tracking here: https://github.com/canonical/craft-providers/issues/211)
2. snapcraft (and other craft applications) should default to use lxd when the host architecture is not amd64

I'll wait on @townsend to chime in. We may not need to implement #2 if it's possible for the Multipass team to work with the Launchpad team and release snapcraft images on other architectures.

I wonder, what is the user story for running snapcraft on MacOS on Apple silicon?

Changed in snapcraft:
status: New → Confirmed
Revision history for this message
Guillaume Beuzeboc (gbeuzeboc) wrote :

Regarding the user story:
I wasn't running snapcraft on Apple Silicon but on an embedded arm64 board (similar to Raspberry Pi).
Snapcraft has no easy way to build an arm64 snap from an amd64 computer (I would prefer not to handle the cross-compilation myself since I am dealing with complex C++/C code), so I must use either arm64 board or arm64 servers to build arm64 snaps (launchpad is not an option, because of private code).
So when working on snaps for embedded devices, running snapcraft on arm64 arch is rather common I would say.

Revision history for this message
Callahan Kovacs (mr-cal) wrote :

Great, thanks for the clarification on usage.

Additionally, I can confirm that the Multipass and CPC teams are working on arm64 support for snapcraft. I don't know if there is an ETA, but you can see some of the work was completed here (https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1966636) and that there are daily buildd images for arm64 (http://cloud-images.ubuntu.com/buildd/daily/jammy/current/jammy-server-cloudimg-arm64-disk1.img).

I think my solution for snapcraft from my earlier comment is still valid.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.