With regard to Cleanbuild remote on pi grabs wrong arch lxc image
Snapcraft assumes the user wants to match the core
snap in an LXD container to the same version as the host. It does this currently by injecting the host-side copy into the container which caused the problem above where the build environment was using a different architecture. In my opinion the solution to restrict the injection is not the correct choice. We should NOT be injecting at all, because most people using snapcraft
to build snaps will not be testing various builds of core
nor snapcraft
itself.
The documentation says that cleanbuild
will “Create a snap using a pristine environment managed by lxd”, which in my mind means that nothing from the host will “leak” into the LXD container. Currently, we are leaking the core
and snapcraft
into the container, which means that builds are unpredictable leading to situations where “it builds on my machine, but the build service doesn’t work”.
Snapcraft should:
- Default to not matching ANYTHING to the host when using LXD containers.
-
core
should be refreshed from the store, not injected from the host. -
snapcraft
should be installed from the snap store, not injected from the host.
-
- Allow overriding the default behaviour above:
- Provide a commandline switch to allow choosing the
core
snap channel to refresh in the container for people who know they really do want a different version than the stable channel. - Provide a commandline switch to allow choosing a different channel for the
snapcraft
installation from the store. - Provide a commandline switch to inject the
core
snap from the host system for developers of thecore
snap or snapcraft to test local changes. - Provide a commandline switch to inject the
snapcraft
from the host system for developers ofsnapcraft
to test local changes.
- Provide a commandline switch to allow choosing the