github canonical/snapcraft 7.0

latest releases: 8.3.0, 8.2.12, 8.2.11...
2 years ago

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 replacing snapcraftctl (this also requires replacing snapcraftctl <step-name> with craftctl default and snapcraftctl set-version <value> with craftctl set version=<value>).
  • Define CRAFT_* environment variables during step execution, replacing SNAPCRAFT_* 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 https://forum.snapcraft.io/t/micro-howto-migrate-from-core20-to-core22/30188 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

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.

Don't miss a new snapcraft release

NewReleases is sending notifications on new releases.