Comment 0 for bug 1602258

Revision history for this message
Neal Gompa (ngompa13) wrote :

The snapcraft tool (and the yaml format) currently mandate Ubuntu repositories as the primary binary input source (that is, the base of snaps created via snapcraft is always Ubuntu).

However, if I want to create a snap using Fedora, CentOS, Mageia, openSUSE, or even Debian as the binary package base, I cannot currently.

There are two particular problems with this:
1) The modern python3-apt API is unavailable for RPM based distributions because apt shipped in RPM based distros is so old that it doesn't work on it. While apt in RPM based distributions does support Debian packages/repositories, it also supports RPM ones. However, since the version of apt is very old (0.5), it doesn't work with This forces snapcraft to only run on Debian based systems.

2) Snapcraft on Debian based systems will always use Ubuntu as the base, which may be undesirable for people who'd like to use Debian software to build their snaps.

My suggestion is to support RPM based distributions by using gir bindings for libhif[1] or the Python 3 API for DNF[2].

Add a stanza where the user can set the distro base, and snapcraft will use the appropriate engine and repo configuration to construct the snap.

Obviously, some place where the distro repo information can be stored as snapcraft config is important too. With the existing code, being able to swap Ubuntu and Debian distro base would be nice.

[1]: https://github.com/rpm-software-management/libhif
[2]: http://dnf.readthedocs.io/en/latest/api.html