Packaging:No Bundled Libraries

From FedoraProject

Jump to: navigation, search

Contents

Why no Bundled Libraries

Although you can request an exception from FPC there are many reasons not to grant one. These are the reasons that it's painful for us to have bundled libraries in the distribution. An exception should only be granted if the value of bundling exceeds these costs.

Security

Forking

Forking is occurring. Once an application starts bundling libraries, it's easy for the project to include local patches to the library to add features that upstream doesn't have or fix bugs that upstream hasn't addressed. This has several negative effects.

Bugfixes

Bugfixes are usually of lesser importance from security issues but share the same issues of hanging onto lingering problems that have been fixed in the main package.

Old Code

Licensing

Although licensing issues can crop up in any project, projects which bundle code from different sources together are a special source of concern. They make auditing for license issues a larger project.

When a Bundled Library is Discovered Post-Review

Bundling of libraries is a serious problem. If a package that is in the distribution is discovered to have bundled libraries we need to fix it. First, open a bug report against the package. Then add the bug to the Duplicate libraries tracker. Once that's done, if help is needed fixing the bug ask on the mailing list.

Exceptions

Exceptions are granted on a case-by-case basis by FPC. You can look in the following section for help on making a case for why an exception should be granted. You should open up a ticket in the FPC's trac with information asked for below.

Standard questions

You must have answers to these standard questions before seeking an exception.

Some reasons you might be granted an exception

This section lists some reasons that might convince FPC that you have a valid reason to be granted an exception. Exceptions are granted on a case by case basis and satisfying the rationale here is not a guarantee of an exception but it's a place to start building your case for why the package you work on is exceptional.

Kernel

If you're packaging the kernel and need to bundle a library you are likely to be granted an exception. The kernel is allowed to bundle libraries as it cannot use user space libraries.

Copylibs

The definition of a copylib is somewhat amorphous. At its basic level, the upstream for the library intends for you to copy the source code of the library into your program, modify it to suit your needs, and then release your software with continuous, forked modifications to that source. Just because you think you're dealing with a copylib does not guarantee that you will be granted an exception. In particular, the programming practice that is common in some java, mono, and scripting language circles of copying external libraries that are otherwise from a separate upstream into the program's source and distributing them together is not allowed. Programs which bundle libraries whose upstream is dead and make bugfixes to the bundled copy is not allowed. As much as possible we want to have a single copy of a library in the distribution which everyone links to.

Some of the criteria that FPC uses to evaluate the copylib case are:

Needing unreleased features

When an application needs unreleased features of a library and that library has committed to those features (usually, the changes are checked into the trunk branch of the upstream's revision control system) but the library has not yet made a release that has that code an exception may be granted to bundle that library until the Fedora packages contain the necessary extra features. Note that for this we would definitely want the standard questions regarding why the Fedora maintainer of the library feels we cannot include a backport of the feature/pre-release snapshot in our package, the timeline for the change to be merged and unbundling to occur to be answered so that we can make sure this is fixed should the package maintainer disappear or get busy with other things.

Note.png
Not for bugfixes
As noted earlier, bugfixes are rarely a good reason for this. Most of the time bugfixes should be backported to the current Fedora package rather than bundling a library.

Modified beyond a certain extent

Modification of a library should not be the only reason given to justify a bundled copy as the two questions come up: why can't these changes go back to the upstream for the library? Why isn't this library forked and released in such a way that others can benefit from the changes as well? However, it can be one of the factors considered. To provide a solid foundation for a bundling exception you should be able to answer those two questions. An explanation that tells why the changes are only useful for the application that's bundling them, for instance.

Requirement if you bundle

Provides: bundled(zlib) = 1.1.14

bundled() denotes that this is a bundled library virtual provide rather than something that other packages would want to depend on. Inside the paranthesis, the binary package that provides the library is listed. (For instance, zlib, bind-libs, NetworkManager-glib, libpng). The version notes which version of the library was bundled. If there's been a lot of incomplete backporting of changes from newer versions of the library, it can be hard to establish what version to use here. A very general rule of thumb is to use the oldest version that seems reasonable as the reason we're doing this is to tell when a library contains issues that have been fixed in newer upstream versions.

Warning (medium size).png
No package should ever Require: a bundled() virtual dependency.

Packages granted exceptions

Library

Provide

Reason

Any binc

bundled(binc)

copylib

Any egglib

bundled(egglib)

copylib

Any gnulib

bundled(gnulib)

copylib

Any libiberty

bundled(libiberty)

copylib

Many instances of md5.c[1]

bundled(md5-$IMPLEMENTATION)[2]

copylib

unac's recoll

bundled(recoll)

this recoll has changes that are not applicable to other applications.

kernel's zlib

bundled(zlib)

Since the kernel cannot use user space libraries, this is has been accepted.

TexStudio's qcodeedit

bundled(qcodeedit)

TexStudio contains a forked copy of qcodeedit 2, which is at least two years dead. Since TexStudio is the only user, there is no benefit to a separated library, and permission to bundle has been granted.

binutils libraries (libbfd, libcpu, libopcodes, libdecnumber)

bundled(binutils) = %{snap} (where %{snap} is defined in the package as the date that the binutils checkout was made)

If the package in question shares the same upstream as binutils (sourceware.org), they may bundle these libraries. This is because the libraries are developed by the application authors as common functionality shared between several applications. Being developers of both, they'll be intimately aware of both issues that arise in the libraries and know how to port to newer versions of the library as needed. Note that, at the moment, all of these applications and libraries come from sourceware.org but not all of them are used in binutils. The name was chosen as it seemed to be the more permanent and recognizable name.

t4k_common's liblinebreak

bundled(liblinebreak)

t4k_common contains a forked copy of an older version of liblinebreak. This is a temporary exception granted until the t4k_common upstream is able to port their code to use the newer system copy of liblinebreak.

Spring RTS's lua implementation

bundled(lua) = X.Y.Z (where X.Y.Z is the base lua version)

Spring RTS includes a forked and bundled copy of Lua which has Spring RTS specific patches applied, must link to streflop, and is configured differently from stock Lua (most importantly it needs lua_Number to be a float and not a double). Lua is particularly important because parts of the game code may be written in it, which must yield exactly identical results (also floating point operations!) on all platforms.

Any okjson

bundled(okjson)

copylib[3]

libtdb_compat and libccan in samba4 packages

bundled(libtdb_compat)
bundled(libccan)

A temporary bundling exception has been granted for libtdb_compat and libccan, but only for samba4 packages. This exception will last until F18 GA, or libtdb 2.x releases, whichever comes first. These libraries are currently being developed by the samba4 upstream as part of libldb, but they will no longer be necessary to be bundled and linked statically when libtdb 2.x is final.

libreplace in samba libraries

bundled(libreplace)

If the package in question shares the same upstream as samba, they may bundle the libreplace library. This is because the libreplace library is developed by the application authors as common functionality shared between several applications. Being developers of both, they'll be intimately aware of both issues that arise in the libraries and know how to port to newer versions of the library as needed.

  1. There are multiple md5 implementations. The ones that have an actual library (libnss, libgcrypt, openssl, libmd, etc) are not covered by this exception. The ones that are copied from other applications are.
  2. Change $IMPLEMENTATION depending on which implementation of md5 is being bundled. The ones known so far are Peter Deutsch's version: bundled(md5-deutsch), Colin Plumb's bundled(md5-plumb), Alexander Peslyak's bundled(md5-peslyak), and Ulrich Drepper's bundled(md5-gcc).
  3. This exception was granted because the upstream explicitly intends for this library to be "vendored" and copied directly into any projects which use it. The Fedora Packaging Committee has a general feeling of distaste for this behavior.

Other distributions

As this is a place where we have to convince upstream that there's a problem, it's good to be able to point out that this is a problem for all distributions, not just Fedora. Here's links to other distribution's policies::