From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: inputs vs. native-inputs vs. propagated-inputs Date: Sun, 10 Jul 2016 14:23:45 -0700 Message-ID: <877fctrxum.fsf@gmail.com> 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> <87ziqe8xyg.fsf@openmailbox.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMMCk-00045F-Od for help-guix@gnu.org; Sun, 10 Jul 2016 17:24:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMMCf-00010i-Mq for help-guix@gnu.org; Sun, 10 Jul 2016 17:23:57 -0400 In-Reply-To: <87ziqe8xyg.fsf@openmailbox.org> (Lukas Gradl's message of "Tue, 21 Jun 2016 08:37:27 -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: help-guix --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Lukas Gradl writes: > 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 th= ink >>>>> 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" becaus= e 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 --referenc= es=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 buil= d, >>>> in =E2=80=98scanForReferences=E2=80=99 in libstore/references.cc. Sin= ce 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 depend= encies, a subset >> of the =E2=80=98inputs=E2=80=99 etc. fields, which are themselves the co= mpile-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 = items >> 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 If you are curious, there is a more detailed explanation of "references" in Eelco Dolstra's PhD thesis, "The Purely Functional Software Deployment Model", available here: https://nixos.org/%7Eeelco/pubs/phd-thesis.pdf You'll find more information about Nix here, much of which applies to Guix also: http://nixos.org/docs/papers.html You'll find more links about Guix here: https://www.gnu.org/software/guix/contribute/ And this repo contains talks etc. about Guix: http://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/ =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXgrzjAAoJEN1AmhXYIkadE84P/1WY7Pri6XT58XihalkBBvks bozDwF9fmfPaOKem0yrN7E3eHsYjx8WnowP1JlpKwp0e6/8EKMiV9CJwZRBK2iIz Lq/dcYCpxFA9o/448iGN98xJGZRLdZoxQh5dOuTcS8bNskZogK04uhbvL1I7KDry Rx6srav/dzv/lQ7R186P2TLrZJlIKnudnujUj38DjCLdbWPvYaF2AywI9CYBq/0J B8QNZ305R8cA3RTxUc8gPkKRXB5KkcsdKkOPVvq4ngsAZORHeYIS905ImIaCD5zt HNjo+SMBcFgBTgrzigGrdlD85dfbsdcjAevU9wk8uhrpGtaKzGrBvsOTbi/Uo4Qo 5y7Oq1fs3+MUUOO0t7CvS0vHXUV3wAw8h+SDFjuCiglKjOw/+L64kcg8beDUR/1d 2JGW5/hKp0sRa8nKWFJzhVg2Awi56PwJOOm7UA36OxTZ1ukAvua26wUKt2SvAicl 5nEw9UEHhhGwDE22R/76tNm2+eaYMupqEUREUECQg1LSrfujUxvrG3yMZ3UTpa9e w1JaQIOKTdZC1txBVLAHSJvBAA5Wn7wgWbcF7YNjXJdU0TYKtQdMQ7NBAM+v/u/c mZT/qG1/Lp/eLwkyz4qyRSYHkK0z8Y4VSgEYuy+672Px4R6p2JEDu9UPb0Knl8Wc fEdd+W12fXY0nBHFujwS =pZ1F -----END PGP SIGNATURE----- --=-=-=--