Disable builds for specific architectures

Hi, I have a snap (Stalefish) which does not, and as far as I can see, will never compile on s390 and a couple of the other platforms. It will only successfully compile for amd64 and arm64 (and that’s fine by me)

I found

which describes how to enable builds ONLY for specific architectures. This means I won’t have all those “failed to build lines” in my builds page. Great.

Unfortunately, when I add:

base: core20
architectures:
  - build-on: [amd64]
  - build-on: [arm64]

or

base: core20
architectures: [amd64, arm64]

only the amd64 build is triggered.

Someone else had this problem: Snapcraft not building all requested architectures but there was no reply to that post.

Is this fixable?

Seb James

You will need the specific build-for: entries as well, else the system thinks wherever you build it it will be able to run on any architecture, so it only tries to build on the first one it finds (amd64 in your case)

That’s interesting thanks. The documentation as written made me think that build-for would be assumed the same as each entry of build-on and so I could omit it.

Wonderful. That worked (but with run-on rather than build-for, as it’s core20). Thank you very much. The solution is:

base: core20
architectures:
  - build-on: [amd64]
    run-on: [amd64]
  - build-on: [arm64]
    run-on: [arm64]

For the benefit of others, the entire snapcraft.yaml file is: https://github.com/ABRG-Models/Stalefish/blob/master/snap/snapcraft.yaml

2 Likes