all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Nicolas Graves via "Development of GNU Guix and the GNU System
	distribution." <guix-devel@gnu.org>
Cc: Nicolas Graves <ngraves@ngraves.fr>
Subject: Re: avoid Computing Guix derivation when not necessary
Date: Sun, 12 Feb 2023 01:10:42 +0100	[thread overview]
Message-ID: <87ilg7n3p9.fsf@gnu.org> (raw)
In-Reply-To: <87v8k9bqk4.fsf@ngraves.fr> (Nicolas Graves via's message of "Fri, 10 Feb 2023 14:25:31 +0100")

Hi Nicolas!

Nicolas Graves via "Development of GNU Guix and the GNU System
distribution." <guix-devel@gnu.org> skribis:

> I found an working solution to avoid waiting for the `Computing Guix
> derivation' part when pulling or else.
>
> Here's my snippet:
>
> ```
> (use-modules
>  (git)
>  (guix profiles)
>  (srfi srfi-1))
>
> (reduce (lambda (x y) (and x y)) #f
>         (map
>          (lambda (x)
>            (let* ((elts (cdadar (manifest-entry-properties x)))
>                   (repository (repository-open (car (assoc-ref elts 'url))))
>                   (commit (oid->string
>                            (object-id
>                             (revparse-single repository
>                                              (car (assoc-ref elts 'branch)))))))
>              (string= commit (car (assoc-ref elts 'commit)))))
>          (manifest-entries (profile-manifest "./.guix-profile/guix"))))
> ```
>
> For the moment, I'm using a profile and local development directories to
> avoid this recomputation when I need to run guix system and guix home,
> but I think this could be included to speed up guix pull when no new
> commits are found.

Wait, ‘guix system’ and ‘guix home’ do not do the infamous “Computing
Guix derivation” step; that’s only for ‘guix pull’, ‘guix time-machine’,
and inferiors.

What are you doing exactly?  :-)

> The principle is simple: get commit and directory info from the profile
> manifest, compare commits, if commits for all channels are the same, do
> not try to update the profile.
>
> It may not be as interessing for guix pull (need to pull anyway to get
> the last commit...). If you think this can have some use, I can rework
> on it for guix ;)

I don’t fully understand the use case yet, but who knows!

One marginal improvement would be sharing the cache that ‘time-machine’
uses with ‘guix pull’.  Last I looked it wasn’t as easy as one might
hope, but I forgot the details.

Thanks,
Ludo’.


  reply	other threads:[~2023-02-12  0:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 13:25 avoid Computing Guix derivation when not necessary Nicolas Graves via Development of GNU Guix and the GNU System distribution.
2023-02-12  0:10 ` Ludovic Courtès [this message]
2023-02-13 10:37   ` zimoun

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=87ilg7n3p9.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=ngraves@ngraves.fr \
    /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.