Cross compile for armhf/arm64 on amd64 host with make plugin

I read many posts on forum, but I do not understand how to make multi arch snap with make plugin. I use make plugin and C/C++ project, my snapcraft.yaml includes these lines:

  - build-on: amd64
    run-on: [armhf, arm64]

but when if try to detect target build arch (SNAPCRAFT_ARCH_TRIPLET/SNAP_ARCH_TRIPLET vars) I got always x86_64-linux-gnu. I tried snapcraft --debug --target-arch=armhf and simple snapcraft --debug.

  1. How to set target arch for make plugin and detect arch inside snapcraft.yaml?
  2. How to install special cross-compile for cross build inside snapcraft.yaml?
  3. Is snapcraft support cross-compile by my scenario or not?
    I am completely confused and cannot understand how to achive this.


As far as I understand there is no support now for cross compile without lxd system and project’s upload to the build server. It is sad :frowning:

As you state, snapcraft does not currently support cross-compilation directly.

You may use or snapcraft remote-build for open source projects to build all supported architectures.

That’s just it, this is not open source project. Maybe there is an opportunity to deploy remote build on our servers…

We are certainly aware of this pain point and hopefully will be able to do some work on this in the coming months… :slight_smile:

It would be great! :slight_smile: