Lxd: Setup image and target arch for cross-compilation

To support cross-compilation in LXD containers the image for the host architecture needs to be used, rather than for the target architecture, which would require slow qemu emulation. It’s worth noting that host here means the host running LXD which may not be the same as the host running snapcraft eg. snapcraft executed on an armhf machine using an amd64 remote building for arm64.

Note: this is orthogonal to actual support for cross-compilation in individual plugins (eg. Go) and only deals with the container setup.

https://github.com/snapcore/snapcraft/pull/1286

2 Likes