anti-patterns: explicit shared lib dependencies
Out of the box bitbake examines built applications, automatically adds
runtime dependencies and thus ensures any library packages dependencies
are automatically added to images, sdks, etc. There is no need to list
them explicitly in a recipe.
Change-Id: Ia19805546eb5808afebbc757e4ca36c562109075
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/anti-patterns.md b/anti-patterns.md
index ab9ab0f..bdad52c 100644
--- a/anti-patterns.md
+++ b/anti-patterns.md
@@ -41,3 +41,34 @@
anti-pattern and the positive effects of solving it in the manner described.
<!-- end copy/paste on previous line -->
+
+## Explicit listing of shared library packages in RDEPENDS in bitbake metadata
+
+### Identification
+```
+RDEPENDS_${PN} = "libsystemd"
+```
+
+### Description
+Out of the box bitbake examines built applications, automatically adds runtime
+dependencies and thus ensures any library packages dependencies are
+automatically added to images, sdks, etc. There is no need to list them
+explicitly in a recipe.
+
+Dependencies change over time, and listing them explicitly is likely prone to
+errors - the net effect being unnecessary shared library packages being
+installed into images.
+
+Consult
+https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-RDEPENDS
+for information on when to use explicit runtime dependencies.
+
+### Background
+The initial bitbake metadata author for OpenBMC was not aware that bitbake
+added these dependencies automatically. Initial bitbake metadata therefore
+listed shared library dependencies explicitly, and was subsequently copy pasted.
+
+### Resolution
+Do not list shared library packages in RDEPENDS. This eliminates the
+possibility of installing unnecessary shared library packages due to
+unmaintained library dependency lists in bitbake metadata.