| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | <sect1 id="ch-prepare-aboutdependencies"><title>About dependencies</title><?dbhtml filename="aboutdependencies.html" dir="chapter02"?><!-- Leave this file in the repo until we figure out finally what to do withdependencies --><para>There are a few ways to compile a list of a package's installationdependencies. What we consider the best way is using the<command>strace</command> program available at <ulinkurl="http://www.wi.leidenuniv.nl/~wichert/strace/"/>.</para><para><command>strace</command> is a program that provides a trace of allsystem calls made by another program. One of the most useful system callsto trace when figuring out dependencies is the <emphasis>execve(2)</emphasis>system call, which is used to execute programs (see its man page forall the details). Whenever you run a program, be it from a shell or via aconfigure script or Makefile file, the execve call is made. If you tracethese calls, you will know what programs were executed behind thescenes.</para><para>Here is a line of output from running a configure script:</para><screen>19580 execve("/bin/rm", ["rm", "-f", "conf19538", "conf19538.exe", "conf19538.file"], [/* 26 vars */]) = 0</screen><para>This line tells us that the <command>/bin/rm</command> program wasrun with a PID of 19580, which command line parameters it was given (rm -fconf195838 conf19538.exe conf19538.file) and its exit value (0).</para><para>For dependency purposes all we care about is that<command>/bin/rm</command> was run during the configure script, so this isan installation dependency. Without <command>rm</command>, the scriptwouldn't be able to run properly.</para><para>Unfortunately, this method is not foolproof. Configure scripts checkfor the presense of many programs, but not all of them are considered realdependencies. For instance, configure scripts may check for the presence ofthe <command>autoconf</command> program. It will be listed in the straceoutput, but it's not a real installation dependency. A package will in mostif not all cases install just fine without that program. There are othersuch false positives.</para><para>This means automatic dependency gathering is never accurate. You willalways need to validate the list and figure out the false positives. Insome (rare) cases autoconf might be a real dependency, so youcan't simply ignore all autoconf entries. A manual validation really is arequirement for an accurate list.</para><para>This book is not so verbose as to list exactly which program from whichpackage is required for a successful installation (we used to, but it hadbecome too much work to maintain it). The book will contain simply thenames of packages you need to have installed. If you need the verbosityin the form of "package a needs file b and c from package d", have a lookat <enter URL when it's available>.</para></sect1>
 |