summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-02-13 08:36:10 -0800
committerPatrick Venture <venture@google.com>2019-02-13 11:59:08 -0800
commitf3fe1216a9417dd4776a03881043984741a7fbae (patch)
treee8992ed77aa171ff6598b4571512bd845283959b
parentd55673e7fdb48fc17121bf45470b02e4c62df560 (diff)
downloadopenbmc-docs-f3fe1216a9417dd4776a03881043984741a7fbae.tar.gz
openbmc-docs-f3fe1216a9417dd4776a03881043984741a7fbae.zip
anti-patterns: explicit missing pkg messages
Nearly all OpenBMC packages rely primarily on other OpenBMC packages to build and link. Therefore, it's generally sufficient to list the missing package via the default missing package behavior. In the event the package name isn't the same as the library expected, then overwriting the error message is still helpful. Change-Id: I9fc6eba07e09480f9e1da8662d202be681c7506e Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--anti-patterns.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/anti-patterns.md b/anti-patterns.md
index 65c2d47..1adcaec 100644
--- a/anti-patterns.md
+++ b/anti-patterns.md
@@ -42,6 +42,37 @@ anti-pattern and the positive effects of solving it in the manner described.
<!-- end copy/paste on previous line -->
+## Explicit AC_MSG_ERROR on PKG_CHECK_MODULES failure
+
+### Identification
+```
+PKG_CHECK_MODULES(
+ [PHOSPHOR_LOGGING],
+ [phosphor-logging],
+ [],
+ [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])])
+```
+
+### Description
+
+The autotools PKG_CHECK_MODULES macro provides the ability to specify an
+"if found" and "if not found" behavior. By default, the "if not found"
+behavior will list the package not found. In many cases, this is sufficient
+to a developer to know what package is missing. In most cases, it's another
+OpenBMC package.
+
+If the library sought's name isn't related to the package providing it, then
+the failure message should be set to something more useful to the developer.
+
+### Resolution
+
+Use the default macro behavior when it is clear that the missing package is
+another OpenBMC package.
+
+```
+PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
+```
+
## Explicit listing of shared library packages in RDEPENDS in bitbake metadata
### Identification
OpenPOWER on IntegriCloud