From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: package dependencies Date: Mon, 14 Dec 2015 09:56:29 +0100 Message-ID: <87h9jlz9vm.fsf@gnu.org> References: <87zixjttsa.fsf@gmail.com> <20151209201329.20594c2e@weiserose.weiserose.de> <20151210045530.GA28215@thebird.nl> <87bn9uxy0l.fsf@gnu.org> <20151214070332.GA13029@jasmine> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8Ovr-0003ji-KY for guix-devel@gnu.org; Mon, 14 Dec 2015 03:56:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8Ovo-0005mk-EF for guix-devel@gnu.org; Mon, 14 Dec 2015 03:56:35 -0500 In-Reply-To: <20151214070332.GA13029@jasmine> (Leo Famulari's message of "Mon, 14 Dec 2015 02:03:32 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Leo Famulari Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Leo Famulari skribis: > On Sun, Dec 13, 2015 at 02:45:46PM +0100, Ludovic Court=C3=A8s wrote: >> Hello! >>=20 >> I=E2=80=99ve rephrased the doc in =E2=80=9Cpackage Reference=E2=80=9D in= a way that is hopefully >> clearer: >>=20 >> =E2=80=98inputs=E2=80=99 (default: =E2=80=98'()=E2=80=99) >> =E2=80=98native-inputs=E2=80=99 (default: =E2=80=98'()=E2=80=99) >> =E2=80=98propagated-inputs=E2=80=99 (default: =E2=80=98'()=E2=80=99) >> These fields list dependencies of the package. Each one is a >> list of tuples, where each tuple has a label for the input (a >> string) as its first element, a package, origin, or derivation >> as its second element, and optionally the name of the output >> thereof that should be used, which defaults to =E2=80=98"out"= =E2=80=99 (*note >> Packages with Multiple Outputs::, for more on package >> outputs). For example, the list below specifies 3 inputs: >>=20 >> `(("libffi" ,libffi) >> ("libunistring" ,libunistring) >> ("glib:bin" ,glib "bin")) ;the "bin" output of Glib >>=20 >> The distinction between =E2=80=98native-inputs=E2=80=99 and = =E2=80=98inputs=E2=80=99 is >> necessary when considering cross-compilation. When >> cross-compiling, dependencies listed in =E2=80=98inputs=E2=80= =99 are built for >> the _target_ architecture; conversely, dependencies listed in >> =E2=80=98native-inputs=E2=80=99 are built for the architecture= of the _build_ >> machine. >>=20 >> =E2=80=98native-inputs=E2=80=99 is typically where you would l= ist tools needed >> at build time but not at run time, such as Autoconf, Automake, >> pkg-config, Gettext, or Bison. =E2=80=98guix lint=E2=80=99 ca= n report likely >> mistakes in this area (*note Invoking guix lint::). >>=20 >> Lastly, =E2=80=98propagated-inputs=E2=80=99 is similar to =E2= =80=98inputs=E2=80=99, but the >> specified packages will be force-installed alongside the >> package they belong to (*note =E2=80=98guix package=E2=80=99: >> package-cmd-propagated-inputs, for information on how =E2=80= =98guix >> package=E2=80=99 deals with propagated inputs.) >>=20 >> For example this is necessary when a library needs headers of >> another library to compile, or needs another shared library to >> be linked alongside itself when a program wants to link to it. > > I think it's a good improvement! This is a big obstacle for new > packagers. > > It may be worth linking between the sections about propagated-inputs and > the python-build-system, since the situation is somewhat different > there. At least in a footnote. Good point. How about the patch below? I=E2=80=99m not sure whether/how to cross-reference from =E2=80=98python-build-system=E2=80=99 & co. since they= don=E2=80=99t mention the problem. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/doc/guix.texi b/doc/guix.texi index 29cea5c..7b7e118 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2305,9 +2305,16 @@ belong to (@pxref{package-cmd-propagated-inputs, @command{guix package}}, for information on how @command{guix package} deals with propagated inputs.) -For example this is necessary when a library needs headers of another -library to compile, or needs another shared library to be linked -alongside itself when a program wants to link to it. +For example this is necessary when a C/C++ library needs headers of +another library to compile, or when a pkg-config file refers to another +one @i{via} its @code{Requires} field. + +Another example where @code{propagated-inputs} is useful is for +languages that lack a facility to record the run-time search path akin +to ELF's @code{RUNPATH}; this includes Guile, Python, Perl, GHC, and +more. To ensure that libraries written in those languages can find +library code they depend on at run time, run-time dependencies must be +listed in @code{propagated-inputs} rather than @code{inputs}. @item @code{self-native-input?} (default: @code{#f}) This is a Boolean field telling whether the package should use itself as --=-=-=--