From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: inputs vs. native-inputs vs. propagated-inputs Date: Sun, 19 Jun 2016 15:44:30 +0200 Message-ID: <87d1nd1ef5.fsf@gnu.org> References: <575D2646.6030000@crazy-compilers.com> <877fdur38e.fsf@member.fsf.org> <575D84C5.5090307@crazy-compilers.com> <20160612195328.GB1615@jasmine> <57646277.4020400@crazy-compilers.com> <20160617233433.GA10924@jasmine> <87vb161esp.fsf@gnu.org> <87vb15n83f.fsf@openmailbox.org> 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]:53356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEd1i-0004Sy-Nv for help-guix@gnu.org; Sun, 19 Jun 2016 09:44:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEd1e-00046z-Er for help-guix@gnu.org; Sun, 19 Jun 2016 09:44:37 -0400 In-Reply-To: <87vb15n83f.fsf@openmailbox.org> (Lukas Gradl's message of "Sat, 18 Jun 2016 22:57:56 -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" To: Lukas Gradl Cc: Hartmut Goebel , help-guix Lukas Gradl skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Leo Famulari skribis: >> >>> I _think_ that `gc --references` works by querying the database for a >>> list of references in the store item you give it as an argument. I think >>> that the information in the database is created after building, by >>> scanning the files of the package's output in /gnu/store, looking for >>> strings that appear to be paths in /gnu/store. I say "I think" because I >>> am not sure. I don't understand that part of the code very well yet. >> >> That=E2=80=99s 100% correct! :-) Namely, =E2=80=98guix gc --references= =E2=80=99 makes an RPC to >> the daemon, which then looks things up in the database (see the =E2=80= =98Refs=E2=80=99 >> table in nix/libstore/schema.sql.) >> >> Scanning for references indeed happens at the end of a successful build, >> in =E2=80=98scanForReferences=E2=80=99 in libstore/references.cc. Since= scanning is >> expensive (I/O-intensive), the result is stored in the database. > > Sorry, this might be a dumb question, I don't quite understand the > concept of these references. Why are references important? Shouldn't > every store item know which other store-items are related to it from the > "inputs"-field in its definition? Why is it necessary to keep track of > the references? The =E2=80=9Creferences=E2=80=9D of a store item are its run-time dependenc= ies, a subset of the =E2=80=98inputs=E2=80=99 etc. fields, which are themselves the compi= le-time dependencies. If those run-time dependencies were not inferred automatically by the daemon, we=E2=80=99d have to maintain them individually, and this would be error-prone and imprecise. Run-time dependency information is what allows Guix to know which substitutes need to be downloaded when installing from substitutes, and it=E2=80=99s what allows the garbage collector to determine which store ite= ms are =E2=80=9Clive=E2=80=9D, and which ones are not. HTH! Ludo=E2=80=99.