unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>,
	"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: Mon, 13 Feb 2023 11:37:18 +0100	[thread overview]
Message-ID: <86bklx7swx.fsf@gmail.com> (raw)
In-Reply-To: <87ilg7n3p9.fsf@gnu.org>

Hi,

On Sun, 12 Feb 2023 at 01:10, Ludovic Courtès <ludo@gnu.org> wrote:

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

Indeed, some improvements could be done in that direction.  For
instance,

--8<---------------cut here---------------start------------->8---
$ guix describe
Generation 89   Jan 17 2023 15:20:08    (current)
  guix 29efa27
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 29efa2791dafb042ca8ace77bcf8538fb404d492

$ guix pull --commit=29efa27
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Building from this channel:
  guix      https://git.savannah.gnu.org/git/guix.git   29efa27
Computing Guix derivation for 'x86_64-linux'... |
[...]
--8<---------------cut here---------------end--------------->8---

Going from one commit to the exact same commit should not trigger some
intensive «Computing Guix derivation».

Note that if I run “guix pull --commit=29efa27” two times in row, the
second one it displays: «nothing to be done» after «Computing Guix
derivation».

Last, note that:

    /var/guix/profiles/per-user/simon/current-guix -> current-guix-90-link

and

--8<---------------cut here---------------start------------->8---
$ /var/guix/profiles/per-user/simon/current-guix-90-link/bin/guix describe
  guix 29efa27
    repository URL: https://git.savannah.gnu.org/git/guix.git
    commit: 29efa2791dafb042ca8ace77bcf8538fb404d492

$ /var/guix/profiles/per-user/simon/current-guix-89-link/bin/guix describe
  guix 29efa27
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 29efa2791dafb042ca8ace77bcf8538fb404d492

$ readlink -f /var/guix/profiles/per-user/simon/current-guix-90-link
/gnu/store/g32zjrbr40fzp1rj5i6gx7hal20myfyv-profile

$ readlink -f /var/guix/profiles/per-user/simon/current-guix-89-link
/gnu/store/pk1i1dsagdby5pqydmvfbffg0i80wwvy-profile

$ diff -r --no-dereference \
  /gnu/store/g32zjrbr40fzp1rj5i6gx7hal20myfyv-profile/manifest \
  /gnu/store/pk1i1dsagdby5pqydmvfbffg0i80wwvy-profile/manifest
12c12
<       "/gnu/store/96bibk75vy5yvmilnycd8pl0l2bydcww-guix-29efa2791"
---
>       "/gnu/store/ldp0snjsac6hp1fikk5b8413pihm77di-guix-29efa2791"
20c20
<             (branch #f)
---
>             (branch "master")
--8<---------------cut here---------------end--------------->8---

Hum, maybe I have something twisted somewhere in my configuration.  From
my understanding, it comes from (guix scripts pull):

--8<---------------cut here---------------start------------->8---
        (match (find guix-channel? channels)
          ((? channel? guix)
           ;; Apply '--url', '--commit', and '--branch' to the 'guix' channel.
           (let ((url (or url (channel-url guix))))
             (cons (match ref
                     (('commit . commit)
                      (channel (inherit guix)
                               (url url) (commit commit) (branch #f)))
--8<---------------cut here---------------end--------------->8---

where ’branch’ should not be #f but instead inherit from ’guix’.  I
remember discussing this but I do not find where. :-)


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

It could be nice! :-)  Last time I gave a look, I had an headache. ;-)

Cheers,
simon


      reply	other threads:[~2023-02-13 10:38 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
2023-02-13 10:37   ` zimoun [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=86bklx7swx.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@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 public inbox

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

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).