unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* avoid Computing Guix derivation when not necessary
@ 2023-02-10 13:25 Nicolas Graves via Development of GNU Guix and the GNU System distribution.
  2023-02-12  0:10 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Graves via Development of GNU Guix and the GNU System distribution. @ 2023-02-10 13:25 UTC (permalink / raw)
  To: guix-devel


Hi guix!

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.

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

-- 
Best regards,
Nicolas Graves


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

end of thread, other threads:[~2023-02-13 10:38 UTC | newest]

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

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