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: 675
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

2.43.1 - Sep 5, 2018

Hello Snapcrafters! The Snapcraft team is pleased to announce that version 2.43.1 is out. This is a minor point release to fix some outstanding issues.

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 Evan Dandrea

New in this release

Core

Extensions

What was previously known as templates is now called extensions and the architecture on which this builds on is now pure python code to allow for future growth and decision making.

The rename takes place to convey that this functionality only extends an existing snapcraft.yaml and does not take part in modifying things that are only in place.

Containers

Build environments will soon be provided by multipass, guaranteeing more consistent results when builds are run from different machines. LXD containers (snapcraft cleanbuild today) will still be supported for existing projects.

In this release we catch up with snapd changes to continue offering a working snapcraft cleanbuild command.

Given the opportunity of modifying this code base, the logic to wait for cloud init has been improved.

Full list of changes

The issues and features worked on for 2.43.1 can be seen on the 2.43.1 launchpad milestone which are reflected in the following change list:

  • lxd: support new style snap injection (#2222)
  • snap: prepare override scripts to allow rebuilding (#2223)
  • lxd: wait for cloud-init (#2227)
  • storeapi: handle releasing to a curly braced branch (#2228)
  • snap: use set-version and set-grade (#2230)
  • lxd: proper filename set when using architectures (#2232)
  • tests: cover manifest generation with review-tools (#2235)
  • reporting: record the released version for errors (#2238)
  • file_utils: find tool when using docker and deb (#2240)
  • elf: better messaging on glibc ABI incompatibilities (#2241)
  • spread: stop running catkin tests on 18.10 (#2221)
  • snapcraftctl: run in isolation mode (#2224)
  • templates: reimplement templates as python classes (#2226)
  • templates: rename to extensions (#2233)
  • cli: add list-extensions command (#2237)
  • extensions: fix install path (#2236)
  • reporting: improve messaging on errors (#2242)

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.43 - Aug 22, 2018

Hello Snapcrafters! The Snapcraft team is pleased to announce that version 2.43 is out.

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

lifecycle

snapcraft now accurately identifies source and build changes and re-executes steps accordingly. This new mode is enabled through configuration in this release. To enable it now, open (or create) ~/.config/snapcraft/cli.cfg and add the following entry:

[Lifecycle]
outdated_step_action = clean

Take a look at the feature in action in the following video, asciicast

build providers

  • Per project SSH key management support was added. Each project will have its own key generated.
  • Snap injection logic has been improved and should be faster for the currently exposed build providers (i.e., multipass).
  • Use of cleanbuild on OS X now defaults to using multipass transparently.
  • Underlying image retrieving logic has been added to have a unique image available to build with any provider which would target a specific base (this is still under the covers and needs enabling).

error reporting

Snapcraft internal errors now prompt to send a report to Sentry, helping us identify the most pressing issues. An option to always report errors has also been added. Set SNAPCRAFT_ENABLE_SILENT_REPORT to a truthful value to automatically send the report.

The prompt asks if you always want to send error reports. If you choose this and change your mind, you can edit the option in snapcraft's configuration.

Take a look at this video to get a quick idea of the error reporting experience: asciicast

manifest

For better tracking of deliverables, if SNAPCRAFT_BUILD_INFO is set, the resulting manifest.yaml will contain the version of snapcraft used to create the snap.

templates

The templates machinery has made it into this release. However, no new template has been added as we want to carefully review any of these with all relevant stakeholders to provide the stability and consistency which was not fully achieved with shared parts.

CLI

templates

Although no template is available today, the commands to work with them are already available (these are working names for the commands and subject to change):

  • template: Show contents of template.
  • expand-templates: Display snapcraft.yaml with all templates applied.
  • templates: List available templates (it is currently missing its counterpart list-templates).

Cleaner output

Tracebacks are now handled in a less verbose manner and stored to a file for inspection instead of printed to the screen.

The verbosity of output when using --debug has been reduced considerably as well, leaving the option with a more user-focused role (i.e., debug the actual project being worked on and not snapcraft itself).

The explicit traceback and the output previously seen when using debug can be enabled through use of an environment variable, SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=yes.

Plugins

go

The go plugin now knows not to install the debs if the well known snap is used.

Here's a video showing off the functionality: asciicast

kernel

As was done with Ubuntu based deb kernels, the kernel plugin now also installs the .config used at the root of the snap as config-$kernelversion.

rust

Given that they are well integrated into cargo, tests are now run for cargo builds.

jhbuild

The jhbuild plugin can now properly run as root and has been greatly simplified.

Full list of changes

The issues and features worked on for 2.43 can be seen on the 2.43 launchpad milestone which are reflected in the following change list:

  • recording: expose the version of snapcraft (#2147)
  • tests: add a fixture for OsRelease to simplify test setup
  • recording: add the os-release ID and VERSION_ID to manifest.yaml
  • nodejs plugin: update to the latest 6.x LTS point release (#2157)
  • snap: use apt from the archive instead of compiling (#2156)
  • build_providers: support for communicating with a qemu VM (#2155)
  • many: refactor snapcraft.yaml loading out of load_config (#2160)
  • tests: update codespell, the scope of checks and ordering of static tests (#2162)
  • rust plugin: fix cargo builds and run tests (#2170)
  • build_providers: add ssh key managemet to the qemu build provider (#2168)
  • ci: disable osx tests until a new pyyaml is released
  • build_providers: inject snaps when running from a snap (#2174)
  • code: use black as the standard style (#2180)
  • cli: reserve the --debug option for snapcraft projects (#2185)
  • state: allow parametrization of the global state file (#2186)
  • errors: enable sentry by default (#2187)
  • file_utils: get_tool_path to always return an absolute path (#2193)
  • errors: support keyboard interrupts (#2198)
  • build_providers: add a build image setup facility (#2192)
  • build providers: better injection logic (#2196)
  • Revert "ci: disable osx tests until a new pyyaml is released" (#2213)
  • providers: multipass by default on darwin (#2215)
  • lifecycle: automatically stage dependencies (#2144)
  • lifecycle: automatically clean dirty steps (#2145)
  • travis: use LXD from 3.0 track (#2149)
  • project_loader: process parts in consistent order (#2146)
  • project_loader: allow loading null parts (#2153)
  • tests: disable sentry (#2154)
  • lifecycle: don't clean priming area if the snap is being tried (#2143)
  • many: extract lifecycle ordering into own module (#2159)
  • many: automatically redo step for specified part (#2152)
  • tests: add lifecycle ordering tests (#2163)
  • many: automatically detect dependency changes (#2165)
  • project_loader: replace dict keys as well as values (#2166)
  • {catkin,python} plugin: support cleaning (#2171)
  • many: add shellcheck to static tests (#2172)
  • lifecycle: detect local source changes (#2167)
  • lifecycle: pass commands to containerbuild, not steps (#2178)
  • cli: SNAPCRAFT_BUILD_ENVIRONMENT isn't deprecated (#2179)
  • pluginhandler: use uname from the host (#2177)
  • store: properly handle disabled deltas (#2181)
  • tests: create basic integration test spread infrastructure (#2173)
  • tests: add spread suite for autotools plugin (#2182)
  • tests: add spread suite for cmake plugin (#2183)
  • spread: stop testing 17.10 (#2197)
  • tests: add spread suite for copy plugin (#2199)
  • tests: add spread suite for nil plugin (#2201)
  • tests: add spread suite for kbuild plugin (#2203)
  • kbuild plugin: stop modifying kconfigfile (#2204)
  • tests: support running spread suite in autopkgtests (#2188)
  • tests: add spread suite for meson plugin (#2205)
  • tests: add spread suite for godeps plugin (#2200)
  • tests: add spread suite for scons plugin (#2208)
  • tests: add spread suite for catkin plugin (#2206)
  • tests: add spread suite for waf plugin (#2210)
  • cli: add inspect subcommand (#2184)
  • tests: add spread suite for tar-content plugin (#2209)
  • tests: add spread suite for ament plugin (#2211)
  • tests: add spread suite for ruby plugin (#2212)
  • project_loader: add basic template support (#2189)
  • spread tests: vendor gotty
  • spread tests: vendor kbuild-template
  • spread tests: vendor hello
  • sentry: support disabling error reporting (#2214)
  • jhbuild plugin: allow running as 'root' (#2141)
  • python plugin: add process-dependency-links to the pull_properties (#2190)
  • ci: improve pr template and tools' ignored files list (#2191)
  • tests: stricter match when running snapcraft revisions (#2195)
  • go plugin: do not install go debs if go snap is used (#2194)
  • kbuild plugin: read configs from source directory instead (#2202)
  • kernel plugin: install .config as config-$kernelversion (#2207)

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.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