Snapcraft 7, the one that supports core22, is now out for testing on latest/candidate and 7.x/candidate.
The goal is to have this relases on 7.x/stable by 2022-06-02T03:00:00Z and on latest/stable on 2022-06-09T03:00:00Z. The reason for this is that the store authorization flow has changed and would need some changes (explained in the release notes further down).
Before moving to core22, please ensure you have read the release notes to verify nothing will affect you by moving over.
Release notes
Support for core22 as a base
Support for the core22
base introduces a new lifecycle with the introduction of craft-parts.
These changes are applicable when switching to core22
:
- Add
craftctl
tool replacingsnapcraftctl
(this also requires replacingsnapcraftctl <step-name>
withcraftctl default
andsnapcraftctl set-version <value>
withcraftctl set version=<value>
). - Define
CRAFT_*
environment variables during step execution, replacingSNAPCRAFT_*
variables. - Remove
try
from advanced grammar, this enables a more predictable planning phase without requiring an execution environment to attest what is tried. With this change, grammar has been generalized enough to allow for adding grammar seamlessly to all snapcraft supported keywords. - Error when duplicate keys are used in snapcraft.yaml.
- Root level
build-packages
no longer supported - Snapcraft now makes use of the global environment keyword instead of command-chain (which allows for easy overriding)
Follow the migration guide for hints on (micro) Howto migrate from core20 to core22 for more information.
Build Providers
With the move to craft-providers, Snapcraft now defaults to LXD as the build environment.
Command Line Interface
Packing or Snapping
The snapping process, to align with other crafting tools, is now called pack. So instead of
$ snapcraft snap
run
$ snapcraft pack
The option of running with no arguments is still supported and defaults to packing:
$ snapcraft
Store operations with externally generated credentials
Snapcraft has migrated to usinng craft-store. The authentication mechanism has changed, impacting those integrating with CI/CD. The snapcraft login --with
command structure is no longer supported or required. The value of export login needs to be exported into the appropriate environment variable (i.e.; SNAPCRAFT_STORE_CREDENTIALS
).
Additionally a working keyring is required to be able to store credentials locally.
Experimental login
To change the authentication mechanism, instead of snapcraft login --enable-experimental-login, instead set SNAPCRAFT_STORE_AUTH=candid
Listing snap names
While still supported, instead of running
$ snapcraft list
run:
$ snapcraft names
Missing features
Don’t migrate yet if you depend on any of these
- Support for the
architectures
keyword - Automatic classic snap building support (ORIGIN paths and linker loader setup)
- Plugins: ROS, crystal, qmake
- Some source handlers: 7zip, mercurial, bazaar, deb, rpm
- Support for user-defined plugins.
Missing features will be ported and added to upcoming 7.x releases. If your snap relies on any of these features, please wait for the next releases to port them to use base: core22
.