From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukas Gradl Subject: Re: inputs vs. native-inputs vs. propagated-inputs Date: Tue, 21 Jun 2016 08:37:27 -0500 Message-ID: <87ziqe8xyg.fsf@openmailbox.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> <87d1nd1ef5.fsf@gnu.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]:49569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFLs4-0003TI-Si for help-guix@gnu.org; Tue, 21 Jun 2016 09:37:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFLs1-000708-Js for help-guix@gnu.org; Tue, 21 Jun 2016 09:37:40 -0400 In-Reply-To: <87d1nd1ef5.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sun, 19 Jun 2016 15:44:30 +0200") 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: Hartmut Goebel , help-guix ludo@gnu.org (Ludovic Court=C3=A8s) writes: > 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 thi= nk >>>> 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 --reference= s=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. Sinc= e 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 depende= ncies, a subset > of the =E2=80=98inputs=E2=80=99 etc. fields, which are themselves the com= pile-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 i= tems > are =E2=80=9Clive=E2=80=9D, and which ones are not. > OK, Thank you for the explanation, this makes more sense to me now! Best, Lukas