I’m currently trying to release a snap (that uses classic confinement) that provides binaries for all the supported architectures. See Classic confinement for austin. By this, I mean that, e.g., if my application is being installed on amd64, then the amd64 binary should be installed instead of the i386.
Presently, I’m using architecture: [ i386, amd64 ] in my snapcraft.yml file, but this seems to produce only a i386 binary. In https://snapcraft.io/build I don’t seem to have the option of specifying multiple build configurations for different architectures.
How can I publish a snap that can provide binaries for all the supported architectures?
Ideally, I’d prefer to have a single snap that knows what to install on each architecture. If this is not possible, I’m happy to have a “snap” and a “snap-i386” variant.
Sorry, what I meant was: you can have a snap that has architectures: [amd64, i386] that would end up being the same blob on either of those architectures, and it would need to have the smarts to figure out which binaries it needs to use in each case (you might want this for example if you want to support tracing a 386 binary on amd64). Or you can have architecture-specific revisions, that is, if you’re on amd64 you only get the amd64 builds. Both are possible.
I just noticed you said
I’m hoping that’s a typo, as 1. it’s architectures, not architecture; and it’s snapcraft.yaml, not snapcraft.yml.
Whatever you do, please don’t do that. The system is architected in such a way that this is not necessary.
If you build in an amd64 machine, it will build an amd64 snap. If you build on armhf you’ll get an armhf snap. At the other end, when a user does a snap install it will only show snaps which are appropriate for their host architecture.