unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: jgart <jgart@dismail.de>
Cc: help-guix@gnu.org
Subject: Re: Why is the <derivation> scheme record needed?
Date: Mon, 19 Sep 2022 09:27:35 +0200	[thread overview]
Message-ID: <877d1zizr4.fsf@elephly.net> (raw)
In-Reply-To: <20220918095836.GF24593@dismail.de>


jgart <jgart@dismail.de> writes:

>> It is a Scheme representation of a derivation, which also has an on-disk
>> representation.
>
> Why was the scheme representation of a derivation needed?

You can search the “guix” directory in the source tree for “derivation-”
to see the many ways that we’re accessing parts of the Scheme
representation of derivation files.  We’re accessing the expected output
location, the list of inputs, we using its fields to build narinfos,
etc.

The only alternative is to hit the disk every time we want to know
something about a derivation and parse the file repeatedly.  That would
be very unwise.

>> Everything that the daemon is asked to build must be compiled to a
>> derivation on disk first.  From the perspective of the daemon there are
>> no first-class packages, only derivations.  Much of what Guix as a
>> library does is to turn package values into derivation files and
>> builders to feed them into the daemon.
>
> Why are the bags needed? What do the bags solve in the system?

The manual says:

--8<---------------cut here---------------start------------->8---
   Under the hood, build systems first compile package objects to
“bags”.  A “bag” is like a package, but with less ornamentation—in other
words, a bag is a lower-level representation of a package, which
includes all the inputs of that package, including some that were
implicitly added by the build system.  This intermediate representation
is then compiled to a derivation (*note Derivations::).
--8<---------------cut here---------------end--------------->8---

Bags are an implementation detail.

-- 
Ricardo


      reply	other threads:[~2022-09-19  7:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17 16:03 Why is the <derivation> scheme record needed? jgart
2022-09-17 18:41 ` Ricardo Wurmus
2022-09-18 14:58   ` jgart
2022-09-19  7:27     ` Ricardo Wurmus [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=877d1zizr4.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=help-guix@gnu.org \
    --cc=jgart@dismail.de \
    /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).