Luca Boccassi wrote:
> Yes, that's the mapping used for both rpm and deb packages, both of
> which have those 3 levels of dependency "strength" (mandatory ->
> optional installed by default -> optional not installed by default).
> The scripts and macros/tools to parse them and use them for package
> builds can be found on the following repo ...
> 
> I think distros using formats other than deb/rpm (arch/nix) were
> looking into this at some point, but I'm not sure of the current
> status and what was implemented, if anything.

Thanks for the confirmation and info. I'm adding documentation for
these priorities.

The wording "core"/"important"/"secondary" functionality is taken from
the spec.

I'm not taking the wording "the binary will work" from the spec, because
it has proven to be subject to interpretation. (Hopefully the terms
"core"/"important"/"secondary" are less subject to discussion.)

The wording "This priority usually maps to ..." is a way to summarize
what your tools do. "usually" because a packager is free to not use the
tools or or may define the package dependencies as they like.

Hope this doc is OK with you?


2026-08-31  Bruno Haible  <[email protected]>

        sd-dlopen: Document the priorities better.
        * lib/sd-dlopen.h: Add comments about the SD_ELF_NOTE_DLOPEN_PRIORITY_*
        macros.

diff --git a/lib/sd-dlopen.h b/lib/sd-dlopen.h
index b3e36ccd77..24ee8aa517 100644
--- a/lib/sd-dlopen.h
+++ b/lib/sd-dlopen.h
@@ -47,8 +47,30 @@ extern "C" {
 
 #define SD_ELF_NOTE_DLOPEN_VENDOR "FDO" /* freedesktop.org */
 #define SD_ELF_NOTE_DLOPEN_TYPE 0x407c0c0a
+
+/* Declares a dependency for "core functionality".
+   This priority usually maps to a package dependency of type "Requires"
+   (called "Depends" on systems with .deb package format).
+   For the package manager, a dependency "A requires B" implies that when
+   A gets installed, B must get installed as well.  */
 #define SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED    "required"
+
+/* Declares a dependency for "important functionality".
+   This priority usually maps to a package dependency of type "Recommends".
+   For the package manager, a dependency "A recommends B" implies that when
+   A gets installed, B gets installed by default.  But the the package manager
+   can be instructed to ignore such dependencies:
+     * Debian/Ubuntu: 'apt --no-install-recommends' or 'debootstrap',
+     * Fedora: 'dnf --setopt=install_weak_deps=False',
+     * openSUSE: 'zypper --no-recommends'.
+   The typical use of such commands is to create "small" environments (e.g.
+   for use in containers).  */
 #define SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED "recommended"
+
+/* Declares a dependency for "secondary functionality".
+   This priority usually maps to a package dependency of type "Suggests".
+   For the package manager, a dependency "A suggests B" does not imply that
+   B gets installed.  Typically B is only shown as suggestion to the user.  */
 #define SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED   "suggested"
 
 #if defined __ELF__ && (defined __GNUC__ || defined __clang__) \




Reply via email to