unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: Lukas Gradl <lgradl@openmailbox.org>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: inputs vs. native-inputs vs. propagated-inputs
Date: Sun, 10 Jul 2016 14:23:45 -0700	[thread overview]
Message-ID: <877fctrxum.fsf@gmail.com> (raw)
In-Reply-To: <87ziqe8xyg.fsf@openmailbox.org> (Lukas Gradl's message of "Tue, 21 Jun 2016 08:37:27 -0500")

[-- Attachment #1: Type: text/plain, Size: 2789 bytes --]

Lukas Gradl <lgradl@openmailbox.org> writes:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Lukas Gradl <lgradl@openmailbox.org> skribis:
>>
>>> ludo@gnu.org (Ludovic Courtès) writes:
>>>
>>>> Leo Famulari <leo@famulari.name> 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’s 100% correct!  :-)  Namely, ‘guix gc --references’ makes an RPC to
>>>> the daemon, which then looks things up in the database (see the ‘Refs’
>>>> table in nix/libstore/schema.sql.)
>>>>
>>>> Scanning for references indeed happens at the end of a successful build,
>>>> in ‘scanForReferences’ 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 “references” of a store item are its run-time dependencies, a subset
>> of the ‘inputs’ etc. fields, which are themselves the compile-time
>> dependencies.
>>
>> If those run-time dependencies were not inferred automatically by the
>> daemon, we’d 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’s what allows the garbage collector to determine which store items
>> are “live”, 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/

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

      reply	other threads:[~2016-07-10 21:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-12  9:07 inputs vs. native-inputs vs. propagated-inputs Hartmut Goebel
2016-06-12 12:38 ` 宋文武
2016-06-12 15:50   ` Hartmut Goebel
2016-06-12 19:53     ` Leo Famulari
2016-06-17 20:49       ` Hartmut Goebel
2016-06-17 23:34         ` Leo Famulari
2016-06-18 19:24           ` Ludovic Courtès
2016-06-19  3:57             ` Lukas Gradl
2016-06-19 13:44               ` Ludovic Courtès
2016-06-21 13:37                 ` Lukas Gradl
2016-07-10 21:23                   ` Chris Marusich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877fctrxum.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=lgradl@openmailbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).