Support for core24
in Snapcraft 8 occurs via the new craft-application library. This allows for cleanup of the “cruft” that inevitably accumulates over the years. Following our commitment to preserve the behaviour and compatibility for existing projects, these changes will only affect Snapcraft projects whose base is core24
. This document outlines important changes when upgrading an existing snap to core24
.
The following features are deprecated in core22
and removed in core24
:
--enable-manifest
and --manifest-image-information
. Generation of the build’s manifest in core24 is controlled exclusively by the SNAPCRAFT_BUILD_INFO
environment variable, and the image information parameter is completely removed.snapcraftctl
command in scriptlets is no longer supported and should be replaced with craftctl
.architectures
top-level property has been replaced by platforms
. See details below.CRAFT_ARCH_TRIPLET
. Use CRAFT_ARCH_TRIPLET_BUILD_FOR
instead.CRAFT_TARGET_ARCH
. Use CRAFT_ARCH_BUILD_FOR
instead.Destructive builds are executed via --destructive-mode
or SNAPCRAFT_BUILD_ENVIRONMENT=host
.
devel
build-bases. In this case the only requirement is that the host be an Ubuntu system.snapcraft remote-build
only allows a single active remote build per project for core24 snaps. As a consequence, snapcraft remote-build --recover
no longer accepts a --build-id
parameter. Instead, snapcraft will recover the remote build for the project in the current working directory.git clone --depth 1
)A new platforms
top-level property is the way for core24 snaps to declare the systems where the snap should be built. This aligns with Charmcraft’s and Rockcraft’s platforms
keyword.
platforms
is optional. If it is not defined, then Snapcraft will build a snap for the host architecture. Valid architectures are defined here.
The syntax is:
platforms:
<platform-name>:
build-on: <list-of-arch> | <arch>
build-for: <list-of-arch> | <arch>
The definitions of build-on
and build-for
are unchanged (see core22 definitions here).
Similar to core22, only one build-for
architecture is supported and it may be defined as a list or a string.
The platform name is a free-form string. Some simplifications are gained if the platform name is a supported architecture:
build-on
and build-for
may be omittedbuild-for
may be omitted if build-on
is definedWhen migrating an existing snap to core24, existing architectures
definitions can be rewritten as platforms
. For example:
architectures:
- build-on: [amd64]
build-for: [amd64]
- build-on: [amd64, arm64]
build-for: [arm64]
can be migrated to core24 as:
platforms:
amd64:
arm64:
build-on: [amd64, arm64]
build-for: [arm64]
For more information on platforms see the how-to, explanation, and reference pages.
snapcraft try
is temporarily not supported. The implementation for core24
snaps has not been finalized.For details on changes between core20
and core22
, see the migrate to core22 page.
Last updated a month ago.