help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is the <derivation> scheme record needed?


From: Ricardo Wurmus
Subject: Re: Why is the <derivation> scheme record needed?
Date: Mon, 19 Sep 2022 09:27:35 +0200
User-agent: mu4e 1.8.7; emacs 28.1

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 via email to

[Prev in Thread] Current Thread [Next in Thread]