[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Improving the speed of guix time-machine for development environment
From: |
Richard Sent |
Subject: |
Re: Improving the speed of guix time-machine for development environments |
Date: |
Sun, 26 May 2024 22:00:43 -0400 |
Hi Guix!
> I think channels listed in channels.scm files should optionally support
> using whatever channel version is already in the user's profile, if
> present. This would significantly speed up entering development
> environments composed of Guix channels.
> Unfortunately, *I may be delayed every time I enter the development
> environment by several minutes while Guix computes a new derivation
> due to an update in %default-channels*.
I wound up implementing a proof of concept for this idea here:
https://www.freakingpenguin.com/blog/guix-tricks-self-referential-channelsscm-files.html
--8<---------------cut here---------------start------------->8---
(define (soft-pin-channel input-channel)
"Given @var{channel}, return a new version of channel that uses the
current profile's commit of said channel. If the channel is not present,
commit is #f."
(define (desired-channel? channel)
(equal? (channel-name input-channel)
(channel-name channel)))
(define (profile-commit input-channel)
(call/ec
(lambda (return)
(map (lambda (x)
(when (desired-channel? x)
(return (channel-commit x))))
(current-channels))
#f)))
(channel
(inherit input-channel)
(commit (profile-commit input-channel))))
--8<---------------cut here---------------end--------------->8---
If people think this is useful, I'm happy to flesh out the idea more and
submit a proper patch. In my experience this does improve the
development experience when setting up developer tools that rely on
custom channels. At least when there's a new Guix commit, I don't have
to wait several minutes for a new Guix channel collection to build, but
without pinning it to a specific commit.
At present I can think of soft-pinning a list of channels by name being
useful. I can also see an option to only fetch dependencies of a
channel, not the channel itself, being useful. I would definitely
appreciate feedback or use cases! :)
--
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.
- Re: Improving the speed of guix time-machine for development environments,
Richard Sent <=