From 8bc6c1c2c817fdc4ee12e165489aab6885fa9e9c Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Tue, 13 Sep 2016 11:15:02 -0700 Subject: ref-manual: New section and updates for runtime dep work fixes [YOCTO #10248] The bulk of this change is a new section called "Automatically Added Runtime Dependencies". Additionally, changes were made to the RDEPENDS and DEPENDS variables. Some cross-referencing to the new material was also added in the do_package task entry, the do_packagedata task entry, the PKGDATA_DIR glossary entry, and the PRIVATE_LIBS glossary entry. (From yocto-docs rev: 16504cd0eb23e102322c6c6096c5b52500a04640) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/ref-manual/technical-details.xml | 107 +++++++++++++++++++++++++ 1 file changed, 107 insertions(+) (limited to 'documentation/ref-manual/technical-details.xml') diff --git a/documentation/ref-manual/technical-details.xml b/documentation/ref-manual/technical-details.xml index 6bad547e50..e5c8eb83b6 100644 --- a/documentation/ref-manual/technical-details.xml +++ b/documentation/ref-manual/technical-details.xml @@ -979,6 +979,113 @@ +
+ Automatically Added Runtime Dependencies + + + The OpenEmbedded build system automatically adds common types of + runtime dependencies between packages, which means you do not need to + explicitly declare the packages using + RDEPENDS. + Two automatic mechanisms exist (shlibdeps and + pcdeps) that handle shared libraries and + package configuration (pkg-config) modules, respectively. + For other types of runtime dependencies, you must manually declare + the dependencies. + + + shlibdeps: + During the + do_package + task of each recipe, all shared libraries installed by the + recipe are located. + For each shared library, the package that contains the shared + library is registered as providing the shared library. + More specifically, the package is registered as providing the + soname + of the library. + The resulting shared-library-to-package mapping + is saved globally in + PKGDATA_DIR + by the + do_packagedata + task. + + Simultaneously, all executables and shared libraries + installed by the recipe are inspected to see what shared + libraries they link against. + For each shared library dependency that is found, + PKGDATA_DIR is queried to + see if some package (likely from a different recipe) contains + the shared library. + If such a package is found, a runtime dependency is added from + the package that depends on the shared library to the package + that contains the library. + + If the library being linked against is versioned + (i.e. includes a version number), then the automatically added + runtime dependency will specify at least that version, as if + "package (>= version)" + had been added to + RDEPENDS. + This dependency forces an upgrade of the package that provides + the shared library when installing the package that depends on + the library, if needed. + + If you want to avoid a package being registered as + providing a particular shared library (e.g. because the library + is for internal use only), then add the library to + PRIVATE_LIBS + inside the package's recipe. + + + pcdeps: + During the + do_package + task of each recipe, all pkg-config modules + (*.pc files) installed by the recipe are + located. + For each module, the package that contains the module is + registered as providing the module. + The resulting module-to-package mapping is saved globally in + PKGDATA_DIR + by the + do_packagedata + task. + + Simultaneously, all pkg-config modules installed by the + recipe are inspected to see what other modules on which the + pkg-config modules depend. + A module is seen as depending on another module if it contains + a "Requires:" line that specifies the other module. + For each module dependency, + PKGDATA_DIR is queried to see if some + package contains the module. + If such a package is found, a runtime dependency is added from + the package that depends on the module to the package that + contains the module. + + The pcdeps mechanism most often infers + dependencies between -dev packages. + + + + + + + The do_package task depends on the + do_packagedata + task of each recipe in + DEPENDS + through use of a + [vardeps] + declaration, which guarantees that the required + shared-library/module-to-package mapping information will be available + when needed as long as DEPENDS has been + correctly set. + +
+
Fakeroot and Pseudo -- cgit v1.2.3-54-g00ecf