I have a snap, which carries some non-architecture specific content. The snapcraft.yaml looks like this:
name: silly-hello
summary: hello
description: random content
version: '1.0'
grade: stable
confinement: strict
base: bare
build-base: core22
architectures:
- build-on: [amd64, arm64]
build-for: all
parts:
hello:
plugin: dump
source: .
We have some self hosted arm64 builders, but folks also use their amd64 hosts for building the snap, hence it lists both arches. Since the resulting content is non-arch-specific,
I’m expecting the snap to list all
in the architectures field in meta/snap.yaml. However, this is what I get:
name: silly-hello
version: '1.0'
summary: hello
description: random content
architectures:
- amd64
base: bare
confinement: strict
grade: stable
environment:
LD_LIBRARY_PATH: ${SNAP_LIBRARY_PATH}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
PATH: $SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH
The snap is tied to a specific architecture and snapd running on arm64
host rightfully rejects artifacts built on amd64
. Funnily enough, the *.snap
file is named: silly-hello_1.0_all.snap
, suggesting that something somewhere did assume all
architectures.
I suspected that maybe something is wrong with interpretation of base: bare
(despite having build-base: core22
) which doesn’t trigger the right behavior, but I can reproduce that even with base: core22
.
The problem is only visible after switching to snapcraft 7.x branch.
maciek@galeon:~ snap list snapcraft
Name Version Rev Tracking Publisher Notes
snapcraft 7.2.9 8619 latest/stable canonical✓ classic
Same this with the candidate/edge.