Snapcraft 2.12 is here and is making its way to your 16.04 machines today.
This release takes Snapcraft to a whole new level. For example, instead of defining your own project parts, you can now use and share them from a common, open, repository. This feature was already available in previous versions, but is now much more visible, making this repo searchable and locally cached.
Without further ado, here is a tour of what’s new in this release.
2.12 introduces ‘
snapcraft update’, ‘
search’ and ‘
define’, which bring more visibility to the Snapcraft parts ecosystem. Parts are pieces of code for your app, that can also help you bundle libraries, set up environment variables and other tedious tasks app developers are familiar with.
They are literally parts you aggregate and assemble to create a functional app. The benefits of using a common tool is that these parts can be shared amongst developers. Here is how you can access this repository.
snapcraft update :refresh the list of remote parts
snapcraft search :list and search remote parts
snapcraft define :display information and content about a remote part
To get a sense of how these commands are used, have a look at the above example, then you can dive into details and what we mean by “ecosystem of parts”.
Snap name registration
Another command you will find useful is the new ‘
register’ one. Registering a snap name is reserving the name on the store.
As a vendor or upstream, you can secure snap names when you are the publisher of what most users expect to see under this name.
Of course, this process can be reverted and disputed. Here is what the store workflow looks like when I try to register an already registered name:
On the name registration page of the store, I’m going to try to register ‘my-cool-app’, which already exists.
I’m informed that the name has already been registered, but I can dispute this or use another name.
I can now start a dispute process to retrieve ownership of the snap name.
Plugins and sources
Two new plugins have been added for parts building: qmake and gulp.
The qmake plugin has been requested since the advent of the project, and we have seen many custom versions to fill this gap. Here is what the default qmake plugin allows you to do:
- Pass a list of options to qmake
- Specify a Qt version
- Declare list of .pro files to pass to the qmake invocation
The hugely popular nodejs builder is now a first class citizen in Snapcraft. It inherits from the existing nodejs plugin and allows you to:
- Declare a list of gulp tasks
- Request a specific nodejs version
SVN is still a major version control system and thanks to Simon Quigley from the Lubuntu project, you can now use
svn: URIs in the source field of your plugins.
Many other fixes made their way into the release, with two highlights:
- You can now use hidden .snapcraft.yaml files
snapcraft cleanbuild’ now creates ephemeral LXC containers and won’t clutter your drive anymore
The full changelog for this milestone is available here and the list of bugs in sight for 2.13 can be found here. Note that this list will probably change until the next release, but if you have a Snapcraft itch to scratch, it’s a good list to pick your first contribution from.
Simply open up a terminal with Ctrl+Alt+t and run these commands to install Snapcraft from the Ubuntu archives on Ubuntu 16.04 LTS
sudo apt update sudo apt install snapcraft
On other platforms
There is a thriving community of developers who can give you a hand getting started or unblock you when creating your snap. You can participate and get help in multiple ways:
- Mailing list: a great place to collaborate and discuss features, bugs and ideas on
snapcraft is the Snapcraft mailing list
- Talk live to other snaps developers on the #snappy IRC channel on Freenode
- If something is not working for you or you’ve spotted a missing feature, feel free to file a bug report
- Ask a question or check out the growing Snapcraft FAQs at Ask Ubuntu
Ubuntu offers all the training, software infrastructure, tools, services and support you need for your public and private clouds.