diff options
author | Scott Rifenbark <srifenbark@gmail.com> | 2016-09-13 11:15:02 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-23 15:27:34 +0100 |
commit | 8bc6c1c2c817fdc4ee12e165489aab6885fa9e9c (patch) | |
tree | 0a37ea47140367bd7c69ed8edab5823c6897fd0c /documentation/ref-manual/technical-details.xml | |
parent | 899ea9cb4839580c7f562e1601e58ac71a6dca4e (diff) | |
download | openembedded-core-contrib-8bc6c1c2c817fdc4ee12e165489aab6885fa9e9c.tar.gz |
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 <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/ref-manual/technical-details.xml')
-rw-r--r-- | documentation/ref-manual/technical-details.xml | 107 |
1 files changed, 107 insertions, 0 deletions
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 @@ </section> </section> +<section id='automatically-added-runtime-dependencies'> + <title>Automatically Added Runtime Dependencies</title> + + <para> + 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 + <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>. + Two automatic mechanisms exist (<filename>shlibdeps</filename> and + <filename>pcdeps</filename>) that handle shared libraries and + package configuration (pkg-config) modules, respectively. + For other types of runtime dependencies, you must manually declare + the dependencies. + <itemizedlist> + <listitem><para> + <filename>shlibdeps</filename>: + During the + <link linkend='ref-tasks-package'><filename>do_package</filename></link> + 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 + <ulink url='https://en.wikipedia.org/wiki/Soname'>soname</ulink> + of the library. + The resulting shared-library-to-package mapping + is saved globally in + <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link> + by the + <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link> + task.</para> + + <para>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, + <filename>PKGDATA_DIR</filename> 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.</para> + + <para>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 + "<replaceable>package</replaceable> (>= <replaceable>version</replaceable>)" + had been added to + <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>. + This dependency forces an upgrade of the package that provides + the shared library when installing the package that depends on + the library, if needed.</para> + + <para>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 + <link linkend='var-PRIVATE_LIBS'><filename>PRIVATE_LIBS</filename></link> + inside the package's recipe. + </para></listitem> + <listitem><para> + <filename>pcdeps</filename>: + During the + <link linkend='ref-tasks-package'><filename>do_package</filename></link> + task of each recipe, all pkg-config modules + (<filename>*.pc</filename> 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 + <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link> + by the + <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link> + task.</para> + + <para>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, + <filename>PKGDATA_DIR</filename> 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. + <note> + The <filename>pcdeps</filename> mechanism most often infers + dependencies between <filename>-dev</filename> packages. + </note> + </para></listitem> + </itemizedlist> + </para> + + <para> + The <filename>do_package</filename> task depends on the + <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link> + task of each recipe in + <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link> + through use of a + <ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'><filename>[vardeps]</filename></ulink> + declaration, which guarantees that the required + shared-library/module-to-package mapping information will be available + when needed as long as <filename>DEPENDS</filename> has been + correctly set. + </para> +</section> + <section id='fakeroot-and-pseudo'> <title>Fakeroot and Pseudo</title> |