all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Sent <richard@freakingpenguin.com>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: Edouard Klein <edou@rdklein.fr>,  guix-devel@gnu.org
Subject: Re: Guix pull: avoiding "Computing Guix derivation"
Date: Mon, 13 May 2024 20:52:23 -0400	[thread overview]
Message-ID: <87jzjx1ago.fsf@freakingpenguin.com> (raw)
In-Reply-To: <875xvh1e9y.fsf@gmail.com> (Simon Tournier's message of "Tue, 14 May 2024 01:30:01 +0200")

Simon Tournier <zimon.toutoune@gmail.com> writes:

> Hi,
>
> On lun., 13 mai 2024 at 17:11, Richard Sent <richard@freakingpenguin.com> wrote:
>
>> Instead of A and B building C directly, A and B download the
>> substitutable Guix package D, then use D to build C. Because D is a
>> reproducible package, it should be substitutable from both A and B.
>> Then, because D->C is the same for everyone, we could substitute the
>> Guix derivation computation for C.
>
> Maybe I am missing some details.  From my understanding, your D is the
> result of the “Computing derivation” dance.  And it is a minimalist
> build because it must work for both cases: with or without substitutes.
>
> Somehow, my understanding of the current process is:
>
>   A -> D  -> C
>   B -> D* -> C
>
> And, D or D* can be the same script.  Here, the property is a kind of
> idempotency.  Hence, C is substitutable.
>
> IIUC, your proposal is to fix D (the intermediary step).  You propose
> the package named ’guix’ that changes barely, but it could be something
> more minimalist.  The requirements is: susbtitutable.  The problem is
> transferred to the first arrow, no?
>
> How can we be sure that A and B points to the same D?
>
> Other said, A lives in the past.  Later, we changed D becoming D*
> because some bugs.  The other revision B lives after this change.
> Therefore, we have the same picture:
>
>   A -> D
>   B -> D*
>
> But then how do we go to C since D and D* does not have a kind of
> idempotent property.
>
> From my understanding, the current situation/process is very similar
> with the one for compiling compiler: you have your new Source of
> compiler and an OldCompiler binary, so you run:
>
>   OldCompiler(Source) -> Compiler
>   and again Compiler(Source) -> NewCompiler
>
> Somehow, whatever the choice of some OldCompiler binary, you get the
> same NewCompiler binary (aside trusting trust attack and friends,
> obviously ;-))

You're correct. This solution wouldn't be sufficient to avoid "Computing
Guix Derivation" for every possible A or B. To my understanding it could
reduce the frequency this occurs.

(To change letters yet again, I'll use Z to refer to the output Guix.)

As a package (either "guix" or a minimalist subset), D, D*, D**, etc.
should all be substitutable. If we consider input Guix's A, B, C, E, F,
..., our original "Compute Guix Derivation" graph would look like:

--8<---------------cut here---------------start------------->8---
     Z
    / \
   /| |\
 /| | | |\
/ | | | | \
A B C E F G
--8<---------------cut here---------------end--------------->8---

i.e. for every possible input Guix (and output Z), we'd need to store a
substitutable intermediate step. Not feasible.

By having A, B, C, ..., use a substitutable Guix package D, our graph
would look like this instead:

--8<---------------cut here---------------start------------->8---
      Z
     /| \
    / |  \
  D   D*  D**
 /|\  |\  |
A B C E F G
--8<---------------cut here---------------end--------------->8---

Assuming D changes significantly less frequently than A, B, C..., I
would think this should be something we could feasibly substitute (at
least for recent D and Z).

Perhaps this isn't viable. I'll confess to not being super familiar with
how build-self.scm operates. At a naive level, $ guix build guix doesn't
need to run "Computing Guix derivation", so if A->D doesn't need to
compute the derivation, and D->Z is substitutable for some subset of D
and Z, I'd think we can skip "Computing Guix derivation" as long as
someone isn't trying to either

a) Use an A that refers to a D********** that's since been GCd

b) Try to get a Z that hasn't been built by D, D*, D**, etc.

Does that sound correct?

-- 
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.


  reply	other threads:[~2024-05-14  0:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 15:04 Guix pull: avoiding "Computing Guix derivation" Edouard Klein
2024-05-13 15:45 ` Ryan Sundberg
2024-05-14 14:32   ` Edouard Klein
2024-06-24 15:25   ` Edouard Klein
2024-05-13 19:28 ` Simon Tournier
2024-05-13 21:11   ` Richard Sent
2024-05-13 23:30     ` Simon Tournier
2024-05-14  0:52       ` Richard Sent [this message]
2024-05-14  9:47         ` Simon Tournier
2024-05-14 14:40           ` Edouard Klein
2024-05-14 10:12 ` Ludovic Courtès
2024-05-14 14:02   ` Richard Sent
2024-05-14 17:29     ` Richard Sent
2024-05-14 14:48   ` Edouard Klein
2024-05-15  8:38     ` Josselin Poiret
2024-05-31 14:02       ` Edouard Klein

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

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

  git send-email \
    --in-reply-to=87jzjx1ago.fsf@freakingpenguin.com \
    --to=richard@freakingpenguin.com \
    --cc=edou@rdklein.fr \
    --cc=guix-devel@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.