+The intent of this page is to collect information on dependency bundling +and static linking as a reference to refer upstream developers, instead of +explaining the same thing repeatedly by e-mail. +
+ + ++Say you develop and distribute a piece of software: a game, a library, anything. +Now, the code is considered bundled if any of the following conditions occur: +
+ ++In other words, code bundling occurs whenever a program or library ends +up containing code that does not belong to it. +
+ + ++There are reasons why bundling dependencies and using static linking occurs; +there are certain benefits to it. So why is it tempting to do such a thing? +
+ + + +
+Especially in Windows, shipping dependencies
+It is tempting when using bundled code on Windows to bundle on GNU/Linux too. +It feels consistent and fits together nicely in the mind of the software +author. +
+ + +
+If a software package
+Bundling
+If
+But publishing and properly maintaining a fork takes time and effort, so
+the developers of
+So why is bundling dependencies and static linking bad after all? +
+ + +
+Let's consider you're a developer of
+Now, a critical important security flaw has been found in
+If a particular distribution has an efficient security upgrade system, the
+patched library can get there in less than 24 hours. But that would be of
+no use to
+Now, depending on how bad things are: +
+ ++In the meantime, users probably even won't know they are running a vulnerable +application just because they won't know there's a vulnerable library +statically linked into the executables. +
+ ++Examples: +
+ ++Say a media player is bundling library libvorbis. If libvorbis is also +installed system-wide this means that two copies of libvorbis: +
+ +
+Due to the
+
+If a program
+This means that
+If the system-installed copy of
+Since the program
+This can potentially result in crashes or strange unpredictable behavior. +
+ +
+This sort of problem can be prevented if library
+Examples: +
+ ++When a bundled dependency is discovered downstream this has a number of +bad consequences. +
+ + + ++So there is a copy of libvorbis bundled with that media player. Which +version is it? Has it been modified? +
+ + ++Before the bundled dependency can be replaced by the system-widely installed +one, we need to know if it has been modified: we have to know if it's a fork. +
+ ++If it is a fork it may or may not be replaced without breaking something. +
+ +
+That's something to find out: more time wasted. If the code says which
+version it is we at least know what to run
+If a bundled dependency doesn't tell its version we may have to find out +ourselves. Mailing upstream could work, comparing against a number of +tarball contents may work too. Lots of opportunities to waste time. +
+ ++Once it is clear that a bundled dependency can be ripped out, a patch is +written, applied and tested (more waste of time). If upstream is willing to +co-operate the patch may be dropped later. If not the patch will need +porting to each new version downstream. +
+ ++ Remove bundled dependency: +
+
+ At best, remove the bundle dependency and allow compilation against
+ dependency
+ That gives flexibility to users on systems without
+ Keep bundled dependency: make usage
+ With a build time option to disable use of the bundled dependency it is + possible to bypass it downstream without patching: nice! +
+
+ When keeping dependency
+ Also: Clearly document if a bundled dependency is a fork or an unmodified + copy and which version of the bundled software we are dealing with. +
+