the original topic of this post was how to properly setup multi-architecture support. Not the specific syntax of the architecture field.
All i care about is having a single snap that runs on multiple architectures! I have the binaries built fine, but creating the package and its dependencies seem to be a nightmare.
To be clear, my issue was solved, but i still feel like iāve just hacked everything together.
in my case, I am shipping binaries which feels like a secondary feature of snap. (since I have to deal with setting lib search paths manually)
A specific example / how-to guide on setting this up is what is needed given the state of the documentation and inconsistent functionality of snapcraft. For it to have any value to anyone it needs demonstration staging packages (libraries) used by the different architectures. I would also recommend showing arm based package staging since out of the box arm packages donāt seem to stage correctly on an amd64ā¦
if you are changing the specification, please include the above/below scenario as a it seems like a typical use case for any multi-arch platform snap of moderate complexity
lets say we create a snap: āSnapPansā
I see 2 generalized cases for artifacts that are deployed with snap:
platform agnostic (content, source files, man pages, etc )
platform specific ( compiled binaries, shared libraries, packages)
I would structure it as follows:
SnapPans\armhf\bin
SnapPans\armhf\lib
SnapPans\arm64\bin
SnapPans\arm64\lib
SnapPans\i386\bin
SnapPans\i386\lib
SnapPans\common\man
anyone would just install it using: āsnap install SnapPansā
Depending on the host architecture, it would run the binaries and use the lib search path for that architecture.
it could download everything, or just the binaries tagged common and specific to that architecture. The latter is just an optimization to be implemented at some point.
The other option is: I could create multiple snaps: SnapPans-arm64, SnapPans-armhf, SnapPans-i386
This is obviously feels like a hack, but given the current state of snapcraft, it is something I know would work.