Swiftpack.co - Package - snapcore/snapcraft

Build Status Coverage Status Code style: black

Snapcraft

Package, distribute, and update any app for Linux and IoT.

Snaps are containerised software packages that are simple to create and install. They auto-update and are safe to run. And because they bundle their dependencies, they work on all major Linux systems without modification.

Build your first snap or learn more about how Snapcraft can help you.

Get support

We’re here to help. Ask your questions at the Snapcraft Forum. Report bugs on Launchpad.

Learn about the latest features by following Snapcraft on Twitter, Google+ or Facebook.

Contribute to Snapcraft

We love contributors. Read the hacking guide if you're interested in helping out.

Github

link
Stars: 632
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

2.42 - Apr 27, 2018

Hello snapcrafters! The snapcraft team is pleased to announce that version 2.42 of snapcraft.

Contributions

This release saw some excellent contributions from outside the snapcraft core team, and we want to give a shout out to those folks. A team thank you to:

New in this release

Core

multipass cleanbuild support

If you are a user of snapcraft cleanbuild and have multipass installed (snap install multipass --beta at the time of this writing) then you might be interested in trying out this new feature, currently triggered by a feature flag. Try it out by running:

$ SNAPCRAFT_BUILD_ENVIRONMENT=multipass snapcraft cleanbuild

sunset remote persistent containers

The feature, hidden behind a feature flag of enabling a remote lxd instance to drive the build with local mounts in place has been removed as a feature due to complexities and trimming of scope towards a unified, working and sustainable interface. Given this was a feature flag and never left its experimental stages, removing it was the right thing to do to remove any expectation that this will be driven further or have user go through a bad experience when using it.

This does not affect using local persistent LXD containers, nor does it affect remote cleanbuilds.

Error reporting

When enabling the snapcraft CLI's use of Sentry by means of setting the feature flag to SNAPCRAFT_ENABLE_SENTRY=on (perhaps in your ~/.bashrc) you will now have the option to always send the traceback instead of being prompted.

architectures keyword

Previous releases of the snapcraft CLI supported an architectures keyword that one could use to specify the architectures on which the snap runs. However, for multiple reasons this proved to be a confusing feature that few could use successfully, so this release sees it reworked to better match user expectations. The architectures keyword has been restructured into a list of more explicit objects, specifying both build and run architecture(s):

architectures:
  - build-on: [<build arch 1>, <build arch 2>]
    run-on: [<run arch 1>, <run arch 2>]

If snapcraft is building on an architecture in build-on, it will use the corresponding run-on in the final snap, stating that it runs on those architectures. Please read the documentation for more details.

Plugins

dotnet

When using override-build, the dotnet plugin can now be used to override the plugin logic.

Full list of changes

Here's the full list of changes that built up to this release:

  • elf: patch everything instead of a subset of elf files (#2081)
  • elf: clear the current runpath before setting the rpath (#2085)
  • python plugin: properly handle distutils on bionic
  • ci: add the python integration tests on bionic for travis
  • many: remove support for remote lxd per project containers (#2089)
  • schema: allow refresh-mode and stop-mode (#2092)
  • packaging: include changelog for setup.py's version detection (#2097)
  • ci: enable OSX testing on travis (#2084)
  • tests: use a common cache for the integration tests
  • tests: remove the SharedCache fixture and uses of it
  • many: allow building in containers with no version in project (#2104)
  • errors: remove logic for SNAPCRAFT_SEND_ERROR_DATA
  • errors: implement the always option to sent to sentry
  • package: make use of snapcraftctl snapcraft features (#2103)
  • nodejs plugin: lazy load the required tarballs (#2106)
  • build_providers: new build provider using multipass (#2100)
  • tests: use FakeSnapd for grammar tests
  • tests: adapt the integration suite to work for all releases
  • project_loader: support architectures for CI (#2080)
  • meta: soften warning about using passthrough (#2091)
  • storeapi: better handle network errors and retries (#2094)
  • grammar: support compound on..to statement (#2088)
  • tests: fix arch-specific integration tests
  • python: bring back support for older versions of pip (#2055)
  • tests: don't use os_release and repo from snapcraft (#2096)
  • lxd: wait for on-going refreshes to finish (#2098)
  • ci: setup AppVeyor (#2087)
  • repo: catch error updating the package cache (#2079)
  • tests: do not shadow deb_arch in architecture scenarios
  • tests: parser tests need the cache
  • tests: don't hard-code expected arch in VersionScriptTestCase
  • dotnet plugin: add dotnet command to path for step overriding (#1909)
  • lifecycle: skip -all-root for base snaps (#2090)
  • tests: update metadata store integration test, no previous push required (#2086)

Final notes

To get the source for this release, check it out on github. For the full extent of changes, take a glance at https://github.com/snapcore/snapcraft/milestone/21?closed=1

A great place to collaborate and discuss features, bugs and ideas on snapcraft are the forums. Please also feel free to file a bug.

Happy snapcrafting! -- Sergio and the team

2.41 - Apr 17, 2018

Hello snapcrafters! The snapcraft team is pleased to announce that version 2.41 of snapcraft.

Contributions

This release saw some excellent contributions from outside the snapcraft core team, and we want to give a shout out to those folks. A team thank you to:

New in this release

Core

Information extraction: setup.py

New in this release, snapcraft has added logic for information extraction from setup.py. Currently only version and description are retrieved from setup.py.

Check the documentation for further use of the feature.

Improved mechanism for overriding lifecycle steps

The feature carrying the name of scriplets has been vastly improved with common understandable logic. To override a step in the lifecycle the semantics are as simple as override-<step>, to call the original logic for the step (useful when wanting to perform operations prior or after the step), one just needs to run within the script snapcraftctl <step>

Furthermore, it is now possible to programatically set the version and grade from within these overriden steps, using whatever logic pertinent or artifact available in that step by eventually calling snapcraftctl set-version <version> and snapcraftctl set-grade <grade>.

Read more about this feature on the documentation site.

passthrough property

Occasionally snapd adds a new experimental feature that may or may not make it to a stable release. In order to support such features as soon as they're added, this release sees the addition of a passthrough keyword that one can use in the root of the YAML as well as in apps and hooks, which can contain properties that are simply passed through to the final snap.yaml.

Error reporting

This release sees the integration of Snapcraft with Sentry. This is still in the testing phases and nothing is enabled by default, but if you would like to enable it and optionally send us any terrible tracebacks you see, simply set SNAPCRAFT_ENABLE_SENTRY=on (perhaps in your ~/.bashrc) and you will be prompted if such an error occurs. Note that no personally identifiable information is sent: just the traceback (which may include the project name).

Plugins

dotnet

Upstream's release information is now used to determine the correct dotnet artifacts to use depending on the target defined in the project.

nodejs

It is now possible to pass an npm-flags list of arguments when using the nodejs plugin.

python

For users experimenting on bionic, snapcraft has caught up with the latest changes to this date occurring there.

Final notes

To get the source for this release, check it out on github. For the full extent of changes, take a glance at https://github.com/snapcore/snapcraft/milestone/18?closed=1

A great place to collaborate and discuss features, bugs and ideas on snapcraft are the forums. Please also feel free to file a bug.

Happy snapcrafting! -- Sergio and the team

2.40 - Mar 24, 2018

Hello snapcrafters! The snapcraft team is pleased to announce that version 2.40 of snapcraft.

Contributions

This release saw some excellent contributions from outside the snapcraft core team, and we want to give a shout out to those folks. A team thank you to:

New in this release

Core

Base support

Initial support for bases has been added. To use this feature for example targeting the new-to-be core18 base snap, Just add this entry to your snapcraft.yaml:

base: core18

You should ideally be running snapcraft from 18.04 to test this feature. Keep in mind that there is still no transparent cleanbuild or project container support for this, it was quickly enabled to get the feature rolling end to end for eager developers wanting to target this new core base.

Improved elf mangling

This functionality is triggered when the build environment is newer than a given base (experimental) or when confinement is set to classic. Most of the improvements are related to the underpinnings of snapcraft to make this a joyful and unsurprising experience as a developer.

This version introduces better detection of DT_NEEDED and snapcraft's lifecycle execution for their discovery. It is now also optimized to only handle these scenarios when creating a snap of type app (the implicit default). There's proper architecture detection of elf files and error handling of non-elf files. The list of RPATH has improved so elf files make use of $ORIGIN for easier relocation (a rather important feature when creating snaps). The extraction of the correct linker has also been optimized.

patchelf has also been SRUed into 16.04 LTS to enable the full extent of architectures out of the box.

execstack

Many binaries that made their way into a snap from pre-built binaries have been making their way in with the execstack bit set on binaries, which caused unexpected behaviors. Given that execstack is not a common thing binaries would need enabled, snapcraft now strips the execstack bit from binaries after going through the files in prime.

This feature can be disabled per part, as the warning for when it happens mentions, by setting:

parts:
    part-name:
        build-attributes: [keep-execstack]

appstream

Better appstream integration, now by making use of common-id under an apps entry, if the information is extracted using the information extraction feature introduced in 2.39, the desktop file and icon is provisioned automatically.

This common-id is also indexed by the Snap Store for proper deduplication of apps on store fronts. Read more about the feature on the new docs site

Plugins

catkin

ROS Kinetic recently released an update that caused Kinetic-based snaps to start failing due to a hard-coded path to Python. This release sees that fixed by the Catkin plugin dynamically rewriting these files to use Python from the PATH instead.

This release also sees the addition of support for recursive rosinstall files. If you have a rosinstall file that resolves to another repository with rosinstall files you also would like to satisfy, simply set recursive-rosinstall: true and Catkin will recursively handle rosinstall files until it has handled them all.

CLI

version

You can now run snapcraft version just as well as snapcraft --version

bash completion

The bash completion script snapcraft has provided has been hooked up to work with the snap.

Final notes

To get the source for this release, check it out on github. For the full extent of changes, take a glance at https://github.com/snapcore/snapcraft/milestone/16?closed=1

A great place to collaborate and discuss features, bugs and ideas on snapcraft are the forums. Please also feel free to file a bug.

Happy snapcrafting! -- Sergio and the team

2.39 - Feb 8, 2018

Hello snapcrafters! The snapcraft team is pleased to announce that version 2.39 has been released.

Contributions

This release saw some excellent contributions from outside the snapcraft core team, and we want to give a shout out to those folks. A team thank you to:

Availability

This new version of snapcraft is now available in the following ways:

  • From the SnapStore, snap install snapcraft (from the stable channel)
  • On a Mac with Homebrew, brew install snapcraft
  • With docker, docker pull snapcore/snapcraft:stable

New in this release

Core

Improved support for classic confinement

We have solidified and unified the experience for classic confined snaps. Creating snaps on 16.04 targeting that same base will now make the necessary arrangements so that runnables and libraries target the correct linker and have the right paths regardless of how the snapcraft project is assembled (source or pre-built binaries).

Experimental support for building on newer stacks

When building on a newer stacks than the base that is being targeted, there is possibility of incompatibilities at the ABI level of the libraries involved, one of those that is noticeable is libc6. To sort through this, when building on newer stacks where this incompatibility may occur an error is issued to prevent the same failure at runtime; with this error, instructions on how to move forward are provided for those wishing to embark in such task.

New "to" keyword in grammar

The grammar which can be used to conditionalize build-packages and stage-packages has grown a new statement. The new "to" statement, analoguous to the existing "on" statement, only evaluates the given packages depending on the target architecture. For example:

build-packages:
  - to armhf:
    - foo
  - bar

In this case, package foo will only be installed when building the snap targeting the armhf architecture. However, package bar is always installed. Furthermore, any package in a to statement will be installed for the target architecture rather than the host version.

In this example, foo has an implicit architecture specific tag matching what is in to, which would make it the same in the example shown to write foo:armhf.

Information extraction

Snapcraft 2.38 added support to extract basic metadata info from appstream files, such as summary and description and making them available in the resulting snap.yaml, allowing to reduce the entry point for specific application information to central point. On this release we have extended that to also extract the icon and desktop files declared in the appstream metainfo.xml file.

CLI

Specify expiration date for exported login

Snapcraft v2.37 gained the ability to export a login that could be used in CI. However, it only supported the default lifespan of one year. This release sees the addition of the ability to specify a shorter lifespan with the --expires option.

Default locale

Snapcraft requires a UTF locale to be set, given that most CI systems have the C locale setup by default, snapcraft now sets a default locale of C.UTF-8 as a fallback locale.

Plugins

kbuild

If, when cross-compiling a kernel, one set the ARCH variable and not the CROSS_COMPILE variable, the kbuild plugin would incorrectly proceed with an empty CROSS_COMPILE variable set, which resulted in a failed build. This release sees the kbuild plugin only use the CROSS_COMPILE variable if it's actually set.

Final notes

To get the source for this release, check it out on github.

A great place to collaborate and discuss features, bugs and ideas on snapcraft are the forums. Please also feel free to file a bug.

Happy snapcrafting! -- Sergio and the team

2.37 - Dec 22, 2017

Hello snapcrafters! The snapcraft team is pleased to announce that version 2.37 has been released.

Contributions

This release saw some excellent contributions from outside the snapcraft core team, and we want to give a shout out to those folks. A team thank you to:

The last three contributors have done so as part of Google's CodeIn initiative.

New in this release

CLI

help command

As a user experience improvement, the snapcraft help command now produces the same output as when running snapcraft --help. Viewing help information related to plugins and other topics previously supported by snapcraft help is still supported.

export-login command

Until now, the only support Snapcraft had baked in for CI systems was the enable-ci command, which only supported Travis, and only supported pushing a given snap to edge. This release sees the addition of a new export-login command that exports a login with the exact capabilities requested, which opens the door to many more possibilities in CI. Want to create a login that can only push a specific snap to edge? No problem. Want to create a login that can only migrate a specific snap from edge to beta? No problem. Here's how it works:

asciicast

Error messages

Another improvement that was developed together with the design team is that now most (if not all) errors have a very well defined semantic explaining first what went wrong followed by a suggestion on how to fix it.

Store

The API to synchronize changes made to the metadata in the snap related to the presentation layer of the store has been extended to support binary assets. So far, icons are the only entry supported. Once a definition is made on other potential assets such as screenshots are made, support for them will be added as well.

To synchronize the data to the store, you need to run the command that was introduced in version 2.34 of snapcraft:

snapcraft push-metadata

Plugins

catkin-tools

This release sees the addition of the catkin-tools plugin. This plugin works similarly to the Catkin plugin, but instead of using Catkin, uses the newer (and faster) Catkin Tools. Catkin Tools is still under beta, as is this plugin, but please give it some mileage!

Final notes

To get the source for this release, check it out on github.

A great place to collaborate and discuss features, bugs and ideas on snapcraft are the forums. Please also feel free to file a bug.

Happy snapcrafting! -- Sergio and the team