Raspian Python project not supported?

I’m attempting to create a Python snap for the raspian OS. Is this possible?

Here is the command I’m running:

$snapcraft --debug --target-arch armhf --destructive-mode
Setting target machine to 'armhf'
The plugin used by 'my-project' does not support cross-compiling to a different target architecture.

I’m using destructive-mode because I’m running Ubuntu 18.04 in a virtual box on a Mac and when I try running snapcraft on the mac, it tries to spin up a mutlipass which ignores the target-arch flag. If I build and deploy an amd64 project, it will not install on the raspbian OS.

Here is the snapcraft.yaml file:

$cat snapcraft.yaml 
name: my-project
version: 0.2.0

confinement: strict
grade: stable
base: core18
architectures: [armhf, arm64]

    plugin: python
    source: .
      - python-six

    daemon: simple
    command: python3 live 

well, the error message pretty much is the answer … the python plugin doesnt support cross compiling, you need to do a native build on an arm device (i’d suggest getting a Pi4 with 4GB and a fast USB3.1 SSD, thats a reasonably fast setup)

Thanks ogra. I was afraid of that. Unfortunately, snapcraft command is not supported on Raspbian OS.

$snapcraft --debug --target-arch armhf --destructive-mode
Setting target machine to 'armhf'
Native builds aren't supported on Raspbian GNU/Linux.

Maybe I can use Ubuntu Mate on RPi4?

snap install lxd and use snapcraft inside an 18.04 lxd container, that is how i do all my arm snaps …

there are now also ubuntu server images for 19.10 somewhere on cdimage.ubuntu.com or you could use my pi4 core18 experimental image (also with lxd and building inside a container) from:

1 Like