Alexander Leidinger

Just another weblog

Jun
03

Direct, indi­rect and explicit depen­den­cies in progams/ports

The dis­cus­sion about direct and indi­rect depen­den­cies is com­ing up again on the FreeBSD mail­inglists. Seems I should make some blog post about it, maybe it makes this topic more find­able than my post­ings in the mailinglists.

Some def­i­n­i­tions:

  • A direct depen­dency from A to B is when program/port A uses sym­bols from library/port B.
  • An indi­rect depen­dency from A to C is when program/port A uses sym­bols from library/port B but no sym­bols from library/port C, and library/port B uses sym­bols from library/port C.
  • An explicit depen­dency from A to C is when it is a direct or indi­rect depen­dency A to C, and when the compiler-time-linker added an explicit ref­er­ence to C to the program/lib of A.

Ide­ally we have no indi­rect depen­den­cies in the explicit depen­den­cies, only direct depen­den­cies. Unfor­tu­nately in real­ity we also have indi­rect depen­den­cies there. This has at least two causes:

  1. libtool (at least 1.x) does not (or was not) come with a hint on FreeBSD, which tells that the run-time-linker is recur­sively resolv­ing dependencies.
  2. Some pkg-config setups list indi­rect depen­den­cies as explicit depen­den­cies (IIRC it depends if Requires.private and/or Libs.private is used in the .pc file or not; if it is used, there should be no indi­rect depen­dency appear from this soft­ware, but I am not 100% sure about this).

Three years ago I wrote /usr/ports/Tools/scripts/explicit_lib_depends.sh, it looks at the files of a given port (it needs to be installed), and prints out explicit depen­den­cies. Because of the indi­rect depen­den­cies which could be listed there, this list is not a list of ports which are real depen­den­cies from a source code point of view, but it reflects the link–time real­ity. If a port C shows up there, the port which is checked needs to be rebuild in case the ABI of library/port C changes.

GD Star Rat­ing
load­ing…
GD Star Rat­ing
load­ing…
Direct, indi­rect and explicit depen­den­cies in progams/ports, 10.0 out of 10 based on 2 ratings
Share/Save

Tags: , , , , , , , , ,

One Response to “Direct, indi­rect and explicit depen­den­cies in progams/ports”

  1. Tweets that mention BLOG: Direct, indirect and explicit dependencies in progams/ports: The discussion about direct and indirect depend... -- Topsy.com Says:

    […] This post was men­tioned on Twit­ter by FreeBSD Project, Ollivier Robert. Ollivier Robert said: Direct, indi­rect and explicit depen­den­cies in progams/ports: The dis­cus­sion about direct and indi­rect depend.. http://bit.ly/dcSLpT #freebsd […]

Leave a Reply