github canonical/snapcraft 3.7
A New Hope

latest releases: 8.2.7, 8.2.6, 8.2.5...
4 years ago

Most of the improvements seen in this release are thanks to the great work done in collaboration with the attendees of the Snapcraft Summit that took place in Montreal this past northern hemisphere Spring time.

Core

Support for more building scenarios

So far Snapcraft has used the existence of the base keyword in snapcraft.yaml to trigger new behavior, this behavior did not consider the creation of bases, that is, a snapcraft.yaml that has:

type: base

In this scenario, the name set in snapcraft.yaml should be used to determine what build environment should be setup, thus:

name: core18
type: base
# base: not set

Shall create an Ubuntu 18.04 based build environment.

For the cases where the base has not been bootstrapped, it shall be possible to set build-base to the name of a base to use in order to setup the build environment, thus, the following will fail due to there not currently being a build environment for core20:

name: core20
type: base
# base: not set

But, can work with:

name: core20
type: base
build-base: core18
# base: not set

Additionally, a new value for type is now allowed, snapd, which would allow the snapd team to move forward in using snapcraft to create a snap for it.

Enhanced support for apps

Added snapcraft schema support (snapcraft.yaml) for recently introduced app properties supported by snapd (snap.yaml), along with additional improvements with regards to error handling and schema checks:

  • Explicitly specify type string for existing options with unspecified type:
    • stop-command
    • reload-command
  • Add daemon type dbus
  • Add daemon options:
    • bus-name (for use with daemon: dbus) with regex pattern found in snapd
    • restart-delay
    • start-timeout
    • timer
    • watchdog-timeout
  • Add on-watchdog for restart-condition
  • Add autostart for apps installing autostart desktop files
  • Specify dependencies on daemon for new daemon options, as well
    as existing options (stop-timeout, restart-condition)
  • Update some descriptions to match https://docs.snapcraft.io/snap-format
  • Add regex patterns for stop timeout (to match introduced timeouts).

Faster iterations when using --use-lxd

Since the general availability of snapd 2.39 it was made possible to retrieve snaps with a proper API in order to inject them into a build environment without requiring root. This provided a common implementation for
build providers (i.e.; LXD and Multipass) to use. In effect this brings the same experience of snap injection (no wasted time re-downloading snaps) when working with snapcraft on a snap enabled system (i.e.; when running snapcraft from the snap).
The end result is that iterating on a snap should be much faster now when using LXD as there is no network overhead.

Improved missing file experience

After priming, instead of simply providing a list of missing dependencies that likely need to be included in the snap, the user is now offered suggestions of stage-packages that may satisfy these dependencies (and build a functioning snap).

This work will be extended in upcoming versions of Snapcraft in order to take into account plugs using the content interface.

Plugins

crystal (new plugin)

This is a new plugin developed by the crystal upstream to work with their recently released crystal snap.

Currently, the following keyword is accepted by the plugin:

  • crystal-channel:
    (string, default: latest/stable)
    The Snap Store channel to install Crystal from.

The crystal developer that attended the recent Snapcraft Summit, wrote a nice summary and example on how to use this plugin, available at https://crystal-lang.org/2019/06/19/snapcraft-summit-montreal.html

conda (new plugin)

This is a new plugin co-developed during the summit with the Anaconda developers.

The conda plugin is pretty straight forward, the following keywords are understood by the plugin:

  • conda-packages
    (list of strings)
    List of conda packages to install.
  • conda-python-version
    (string)
    The python version to use for the conda packages.
    Defaults to the latest supported by miniconda.
  • conda-miniconda-version
    (string)
    The version of miniconda to bootstrap.
    Defaults to the latest release of miniconda.

rust

A rust developer has reviewed the plugin and suggested improvements which have made it into this release.

One of those improvements was defaulting to the usage of the rust-toolchain file (if present), unless explicitly overridden by use of rust-channel or rust-revision.

Rebuilding is now also possible using this plugin.

ant

The publisher for ant has released a snap and after a review of the plugin from the publisher, the ant plugin was updated to support the use of this new snap for building ant-based projects.

The following new keywords are accepted by the plugin:

  • ant-channel:
    (string)
    The channel to use for ant in the snap store, if not using tarball from
    the ant archive (see ant-version and ant-version-checksum).
    Defaults to latest/stable.

The publisher for ant has also reviewed the plugin to satisfaction.

colcon

Support for dashing was added to the colcon plugin in order to support this latest ROS release.

Bug fixes

There have been many bug fixes in this release, of those worth mentioning are:

  • improved error handling.
  • additional appstream icon extraction scenarios taken into account.
  • modified handling of in-snap symlinks, specifically to better accommodate the merged /usr directory scheme.
  • click.prompt and click.confirm expanded to query the existence of tty for stdin.

--

The full list of features and issues worked on are listed below

Sergio Schvezov

  • 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

Chris Patterson

  • 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)

Mike Miller

  • build providers: enforce well-known temp dir (#2607) (LP: #1833292)

Pawel Stolowski

  • schema: allow snapd as snap type (#2609)

Claudio Matsuoka

  • echo: add wrappers for click.prompt() and click.confirm()

Kyle Fazzari

  • colcon plugin: add support for dashing (#2593)

anatoly techtonik

  • cli: add -h short option for help (#2527) (LP: #1807423)

Stefan Bodewig

  • use the stable risk level now that ant has been released

Chris MacNaughton

  • rust plugin: add ability to rebuild (#2620) (LP: #1825858)

Carlo Lobrano

  • tools: let environment-setup.sh skip unnecessary steps (#2625)

Don't miss a new snapcraft release

NewReleases is sending notifications on new releases.