Backwards compatible change to Snapcraft’s current default provider (Multipass) to LXD when running on a Linux environment.
Snapcraft today defaults to Multipass, as a default when running on native hardware, it provides the best experience for a common environment across all supported platforms (i.e.; Linux, Windows and OS X).
This however is a hindrance on machines with low RAM or systems that already run within a virtual environment, leading to having to deal with virtual machine nesting which is not as easy or straightforward to setup.
Multipass does not support the advanced storage options that allow for data deduplication nor does it support snapshots which have the potential of making the bootstrapping of an environment a lot smoother.
Open continuous integration systems would also benefit as those usually run inside constrained environments.
These are the premises for the specification:
- Existing projects should not change
- A change in
snapcraft.yamlor user set toggle defines a new behavior.
This implies that Snapcraft should keep Multipass as the default for all existing projects and no unnoticed change will change this default. Existing projects that require LXD to be used shall keep using
--use-lxd to make that so.
Historically, Snapcraft has made changes to defaults or build behaviors when the
base was changed in
snapcraft.yaml. Snapcraft can then do then select Multipass by default when the base is (or
And select LXD for when any other base is used. The reason to not say
core22 and newer is that base introduction is not linear (e.g.;
core22 may not be the next add base Snapcraft adds support for).
Setting a default
For users that want to keep a consistent user experience on a given system, no matter the base used to run Snapcraft against the project, Snapcraft (the snap), will make use of snap’s configure command, such that a user can execute:
snap set snapcraft provider <multipass|LXD>
A one time warning must be displayed when using bases that default to Multipass mentioning that the default will change when migrating to a newer base, with a notification about how to keep the current default before this comes into effect on Linux systems:
LXD will be the default environment for projects when changing base in snapcraft.yaml from core,
core18 and core20. Run `snap set snapcraft provider multipass` to keep the current default.