Release notes: Snapcraft 3.7
Many of the improvements in this release are thanks to the great work done in collaboration with the attendees of the 2019 Snapcraft Summit that took place in Montreal.
New core features
Extended build options
Prior to the release of Snapcraft 3.7, using the
base keyword within
snapcraft.yaml to specify a base type for a snap did not take into account the creation of bases. Instead, the
name keyword was arbitrarily used to determine the build environment:
name: core18 type: base # base: is not set elsewhere
The above example uses
name to specify the creation of an Ubuntu 18.04 (core18) based build environment.
This fails if a base has yet to be bootstrapped, or is otherwise unavailable. For example, the following will currently generate a `launch failed: Unable to find an image matching “core20” error:
name: core20 type: base # base: is not set elsewhere
In cases like the above, where the base has not yet been bootstrapped,
build-base can be used to explicitly define the base to use for the build environment.
To solve the above issue, for example, use the following:
name: core20 type: base build-base: core18 # base: is not set elsewhere
snapd is a new value for base type. Its inclusion will help the snapd team when using Snapcraft to build their own snap.
- It’s now possible to specify the type string for the following existing options with an unspecified type:
- Daemon options:
- New daemon type:
bus-name(for use with
daemon: dbus). Uses regex pattern found in snapd
- daemon dependencies can be specified as well as existing options (
- New daemon type:
autostartfor apps installing autostart desktop files
regex patterns added to
stop-timeout(to match introduced timeouts).
Faster LXD build iterations
This is thanks to snapd 2.39 supporting API snap retrieval, and is used to avoid a root requirement when adding snaps to the build environment. It means snap don’t need to be re-downloaded as frequently.
Improved missing file experience
After the prime stage has completed, and missing dependencies are detected, Snapcraft now lists these as stage-packages, rather than as a simple list, for inclusion in snapcraft.yaml to hopefully build a functioning snap.
This will be extended in upcoming versions of Snapcraft to take into account plugs using the
crystal (new plugin)
The following keyword is currently accepted by the plugin:
The Snap Store channel to install Crystal from.
Brian J. Cardiff, one of Crystal’s developers, attended the 2019 Snapcraft Summit Montréal and wrote an excellent overview of how to use the plugin as part of an event write-up. See Snapcraft Summit Montréal for the post.
conda (new plugin)
Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. This plugin was developed during the 2019 Snapcraft Summit Montréal with the Anaconda developers.
This plugin uses the following plugin-specific keywords:
conda-packages(list of strings)
List of conda packages to install.
The Python version to use for the conda packages.
Defaults to the latest supported by Miniconda.
The version of Miniconda to bootstrap.
Defaults to the latest release.
The Rust plugin has been reviewed by a Rust developer and their suggestions incorporated into this release.
One such improvement is defaulting to use the
rust-toolchain file (if present), unless explicitly overridden by use of
Rebuilding is now also possible using this plugin.
The following new keywords are now accepted by the plugin:
If not using the Ant tarball from the Ant archive (see ant-version and ant-version-checksum, this keyword specifies the channel to use for ant in the Snap Store.
There have been many bugs fixed in this release. Some of the most significant are as follows:
- improved error handling
- additional AppStream icon extraction scenarios that are now taken into account
- modified handling of in-snap symlinks, specifically to better accommodate the merged
click.confirmexpanded to query the existence of tty for stdin.
Full list of changes
The full list of features and issues worked on in this release are listed below.
List of changes for Snapcraft 3.7
- static: use beta channel for black (#2606)
- catkin spread tests: dump apt-config on failures for legacy (#2610)
- rust plugin: use toml to dump the config (#2611)
- rust plugin: use rust-toolchain by default if present (#2613)
- conda plugin: new plugin (#2608)
- build providers: support injection for LXD (#2621)
- schema: remove support for os when using bases (#2626)
- appstream extractor: skip non icon file paths (#2630)
- spread tests: enable LXD build provider tests (#2631)
- build environment: detect base type and use name as base
- plugins: use get_build_base to determine base support
- project: add support for build-base
- repo: add support for querying file ownership
- pluginhandler: suggest stage-packages for missing DT_NEEDED
- tests: add python3-toml for autopkgtests
- spread tests: limit conda plugin to non autopkgtests x86-64 systems
- spread tests: crystal tests should only run on x86-64
- black: minor format changes from updated black (#2603)
- sources: introduce SnapcraftSourceNotFoundError (#2604)
- spread: use more workers to reduce job times
- catkin/legacy-pull: set test to manual
- cli: convert users of click.confirm/prompt to echo.confirm/prompt
- echo: respect SNAPCRAFT_HAS_TTY for is_tty_connected()
- ant plugin: switch to using ant snap for building (by default)
- general spread tests: set base for cwd test (#2618)
- errors: refactor exception/error handling (#2602)
- tests/unit/pluginhandler: introduce tests to repro symlink preservation bug
- file_utils/create_similar_directory: drop follow_symlinks option
- pluginhandler: honour symlink directory paths for filesets (LP: #1833408)
- test_pluginhandler: remove faulty (redundant) tests
- schema: synchronizing snapd supported schema to snapcraft (#2627)
Brian J. Cardiff
- crystal plugin: new plugin (#2598)
- build providers: enforce well-known temp dir (#2607) (LP: #1833292)
- schema: allow snapd as snap type (#2609)
- echo: add wrappers for click.prompt() and click.confirm()
- colcon plugin: add support for dashing (#2593)
- cli: add -h short option for help (#2527) (LP: #1807423)
- use the stable risk level now that ant has been released
- rust plugin: add ability to rebuild (#2620) (LP: #1825858)
- tools: let environment-setup.sh skip unnecessary steps (#2625)
Last updated 2 years ago.