[2bd9e12] | 1 | <sect1 id="ch02-aboutdependencies">
|
---|
| 2 | <title>About dependencies</title>
|
---|
| 3 | <?dbhtml filename="aboutdependencies.html" dir="chapter02"?>
|
---|
| 4 |
|
---|
[0eb0afb4] | 5 | <!-- Leave this file in the repo until we figure out finally what to do with
|
---|
| 6 | dependencies -->
|
---|
| 7 |
|
---|
[2bd9e12] | 8 | <para>There are a few ways to compile a list of a package's installation
|
---|
| 9 | dependencies. What we consider the best way is using the
|
---|
| 10 | <command>strace</command> program available at <ulink
|
---|
| 11 | url="http://www.wi.leidenuniv.nl/~wichert/strace/"/>.</para>
|
---|
| 12 |
|
---|
| 13 | <para><command>strace</command> is a program that provides a trace of all
|
---|
| 14 | system calls made by another program. One of the most useful system calls
|
---|
| 15 | to trace when figuring out dependencies is the <emphasis>execve(2)</emphasis>
|
---|
| 16 | system call, which is used to execute programs (see its man page for
|
---|
| 17 | all the details). Whenever you run a program, be it from a shell or via a
|
---|
| 18 | configure script or Makefile file, the execve call is made. If you trace
|
---|
| 19 | these calls, you will know what programs were executed behind the
|
---|
| 20 | scenes.</para>
|
---|
| 21 |
|
---|
| 22 | <para>Here is a line of output from running a configure script:</para>
|
---|
| 23 |
|
---|
| 24 | <screen>19580 execve("/bin/rm", ["rm", "-f", "conf19538", "conf19538.exe", "conf19538.file"], [/* 26 vars */]) = 0</screen>
|
---|
| 25 |
|
---|
| 26 | <para>This line tells us that the <command>/bin/rm</command> program was
|
---|
| 27 | run with a PID of 19580, which command line parameters it was given (rm -f
|
---|
| 28 | conf195838 conf19538.exe conf19538.file) and its exit value (0).</para>
|
---|
| 29 |
|
---|
| 30 | <para>For dependency purposes all we care about is that
|
---|
| 31 | <command>/bin/rm</command> was run during the configure script, so this is
|
---|
| 32 | an installation dependency. Without <command>rm</command>, the script
|
---|
| 33 | wouldn't be able to run properly.</para>
|
---|
| 34 |
|
---|
| 35 | <para>Unfortunately, this method is not foolproof. Configure scripts check
|
---|
| 36 | for the presense of many programs, but not all of them are considered real
|
---|
| 37 | dependencies. For instance, configure scripts may check for the presence of
|
---|
| 38 | the <command>autoconf</command> program. It will be listed in the strace
|
---|
| 39 | output, but it's not a real installation dependency. A package will in most
|
---|
| 40 | if not all cases install just fine without that program. There are other
|
---|
| 41 | such false positives.</para>
|
---|
| 42 |
|
---|
| 43 | <para>This means automatic dependency gathering is never accurate. You will
|
---|
| 44 | always need to validate the list and figure out the false positives. In
|
---|
| 45 | some (rare) cases autoconf might be a real dependency, so you
|
---|
| 46 | can't simply ignore all autoconf entries. A manual validation really is a
|
---|
| 47 | requirement for an accurate list.</para>
|
---|
| 48 |
|
---|
[791dec6] | 49 | <para>This book is not so verbose as to list exactly which program from which
|
---|
[0eb0afb4] | 50 | package is required for a successful installation (we used to, but it had
|
---|
[2bd9e12] | 51 | become too much work to maintain it). The book will contain simply the
|
---|
| 52 | names of packages you need to have installed. If you need the verbosity
|
---|
| 53 | in the form of "package a needs file b and c from package d", have a look
|
---|
| 54 | at <enter URL when it's available>.</para>
|
---|
| 55 |
|
---|
| 56 | </sect1>
|
---|
| 57 |
|
---|