From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Design decision behind inputs/native-inputs/propagated-inputs Date: Thu, 21 Jan 2016 10:59:53 +0100 Message-ID: <877fj32qxy.fsf@gnu.org> References: <20160121044909.GA18348@stebalien.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMC2F-0006SC-19 for help-guix@gnu.org; Thu, 21 Jan 2016 05:00:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMC29-000203-Qo for help-guix@gnu.org; Thu, 21 Jan 2016 05:00:10 -0500 In-Reply-To: <20160121044909.GA18348@stebalien.com> (Steven Allen's message of "Wed, 20 Jan 2016 23:49:09 -0500") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org To: Steven Allen Cc: help-guix@gnu.org Hello, Steven Allen skribis: > I just attended David Thompson's talk about Guix and asked some Cool, glad that it led you to contact us! ;-) > Currently, I use Arch. On Arch, we have makedepends and depends where > only depends are kept at runtime. On Guix, this distinction is detected > at build time by searching the output files for references into the > inputs. However, unless I'm mistaken, native-inputs are *usually* build > dependencies and inputs are *usually* runtime dependencies. So, my > question is why not: > > 1. Get rid of the automagic run/build dependency detection. > 2. Have: > a. private-inputs -- runtime dependencies not linked into the environme= nt > b. propagated-inputs -- no change > c. build-inputs -- always native, never included in the final output > > Specifically, what is the use case for non-native build-only dependencies= =20 > (inputs that are not included in the final package) and native runtime > dependencies (native-inputs that *are* included in the final package)? > Alternatively, am I completely missing the point? The description of these three things has been improved in the manual on =E2=80=98master=E2=80=99, compared to what=E2=80=99s on the on-line manual: --8<---------------cut here---------------start------------->8--- =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: `(("libffi" ,libffi) ("libunistring" ,libunistring) ("glib:bin" ,glib "bin")) ;the "bin" output of Glib 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. =E2=80=98native-inputs=E2=80=99 is typically where you would list= 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 can r= eport likely mistakes in this area (*note Invoking guix lint::). 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=98gu= ix package=E2=80=99 deals with propagated inputs.) 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 via its =E2=80=98Requires=E2=80=99 fie= ld. Another example where =E2=80=98propagated-inputs=E2=80=99 is usef= ul is for languages that lack a facility to record the run-time search path akin to ELF=E2=80=99s =E2=80=98RUNPATH=E2=80=99; this includ= es 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 =E2=80=98propagated-inputs=E2=80=99 rather than =E2=80=98inputs= =E2=80=99. --8<---------------cut here---------------end--------------->8--- In short, the distinction between =E2=80=98native-inputs=E2=80=99 and =E2= =80=98inputs=E2=80=99 exists solely because Guix supports cross-compilation. Otherwise it would be unneeded. Propagated inputs are a way to manually say: =E2=80=9CI want this package to automatically pull in those other packages.=E2=80=9D This is necessary in = the cases given above. Does this clarify the rationale? Thanks for your feedback, Ludo=E2=80=99.