Snapcraft plugins

Plugins are used by the snapcraft command to build a snap from parts defined within snapcraft.yaml.

Commonly used plugins include Python, Go, Java, cmake and autotools, and these help when working with projects written in a specific language or with a specific set of build tools.

These, and many other plugins, are included with Snapcraft, all of which can be listed with the following command:

snapcraft list-plugins

If the working directory contains a Snapcraft project, the default behaviour is to show only the plugins available for either its specified base or the latest available supported base.

To list plugins specific to a defined base, run the following command:

$ snapcraft list-plugins --base core22
Displaying plugins available for 'core22'
ant
autotools
cmake
dotnet
dump
go
make
maven
meson
nil
npm
python
rust
scons
colcon
conda
flutter
kernel

For further details on specific plugins, see Supported plugins, and to create your own, see Writing local plugins.

1 Like

For other examples of plugins used in real world, or to see how to override/extend functionalities in of the official plugins, you can check out this:

1 Like
$ snapcraft list-plugins --base core18
Usage: snapcraft list-plugins [OPTIONS]
Try 'snapcraft list-plugins -h' for help.

Error: no such option: --base

$ snapcraft --version
snapcraft, version 3.11

Thanks for bringing this to our attention. We should have made it clear that --base applies to Snapcraft 4.0 which is imminent but currently in candidate.

Not so much a docs issue, but there is a weird inconsistency in listing plugins for base=core22. Just for fun, I created a snap with base=core22, then:

$ snapcraft list-plugins --base=core22
Usage: snapcraft list-plugins [OPTIONS]
Try 'snapcraft list-plugins -h' for help.

Error: Invalid value for '--base': 'core22' is not one of 'core18', 'core20'.

Fair enough, but this works with that same snap:

$ snapcraft list-plugins
Displaying plugins available for 'core22'
autotools  catkin  catkin-tools  cmake  colcon  conda  dump  go  make  meson  nil  npm  python  qmake  rust

That seems inconsistent.

I believe it could be useful to update the first sentence to be more like a definition. Something like:

[…] In Snapcraft, a plugin is the mechanism to encode logic to a part. A plugin customises the lifecycle steps of a part included in snapcraft.yml, so it is easier to integrate specific languages, tools or platforms.

A plugin can provide plugin-specific keywords and interpret build environment entries. Plugins can be dependent on specific bases and extensions. […]

Hi,

the commands here don’t work anymore:

0 $ snapcraft help python
There is no help topic, plugin or command 'python'. Try:

For topics:

    snapcraft help topics

For valid plugins:

    snapcraft list-plugins

Or for general help:

    snapcraft help

Thanks so much for letting us know. I’ll remove the plugin details for now and hopefully the Snapcraft team can update this with whatever new equivalent there might be.