unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Why is the <derivation> scheme record needed?
@ 2022-09-17 16:03 jgart
  2022-09-17 18:41 ` Ricardo Wurmus
  0 siblings, 1 reply; 4+ messages in thread
From: jgart @ 2022-09-17 16:03 UTC (permalink / raw)
  To: Guix Help

Hi,

Why is the <derivation> scheme record needed?

How does it function in Guix?

all best,

jgart


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why is the <derivation> scheme record needed?
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2022-09-17 18:41 UTC (permalink / raw)
  To: jgart; +Cc: help-guix


jgart <jgart@dismail.de> writes:

> Why is the <derivation> scheme record needed?

It is a Scheme representation of a derivation, which also has an on-disk
representation.

> How does it function in Guix?

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.

-- 
Ricardo


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why is the <derivation> scheme record needed?
  2022-09-17 18:41 ` Ricardo Wurmus
@ 2022-09-18 14:58   ` jgart
  2022-09-19  7:27     ` Ricardo Wurmus
  0 siblings, 1 reply; 4+ messages in thread
From: jgart @ 2022-09-18 14:58 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix

On Sat, 17 Sep 2022 20:41:43 +0200 Ricardo Wurmus <rekado@elephly.net> wrote:

Hi rekado,

Thanks for the explanations! Much appreciated. Here are some more questions:

> It is a Scheme representation of a derivation, which also has an on-disk
> representation.

Why was the scheme representation of a derivation needed?

Was it primarily so that we can inspect it at the REPL like a scheme
object before it gets sent to disk or is there some additional reason?

> 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?

all best,

jgart


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why is the <derivation> scheme record needed?
  2022-09-18 14:58   ` jgart
@ 2022-09-19  7:27     ` Ricardo Wurmus
  0 siblings, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2022-09-19  7:27 UTC (permalink / raw)
  To: jgart; +Cc: help-guix


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-19  7:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).