From: Tomas Volf <~@wolfsden.cz>
To: guix-devel@gnu.org
Subject: How to cache the result of guix-for-channels?
Date: Sat, 24 Aug 2024 22:01:29 +0200 [thread overview]
Message-ID: <87msl1wuzq.fsf@wolfsden.cz> (raw)
[-- Attachment #1: Type: text/plain, Size: 2464 bytes --]
Hi all,
I am finally trying to incorporate `guix-for-channels' into my system
configuration and cannot figure out how to make it cache the resulting
package.
Following snippet illustrates the problem:
--8<---------------cut here---------------start------------->8---
/tmp/repro $ cat x.scm
(use-modules (guix channels)
(gnu packages package-management))
(guix-for-channels (list (channel
(name 'guix)
(url "https://git.wolfsden.cz/.git/guix")
(commit
"b03eddc326ee4eb26b25743faee2080de6aded7e")
(introduction
(make-channel-introduction
"028e445a2028068e3c83996daa281057f19141a0"
(openpgp-fingerprint
"B783 49B3 8C14 7D36 2988 68A4 2FBF EE7D B67F C1A9"))))))
/tmp/repro $ guix build -f x.scm
Updating channel 'guix' from Git repository at 'https://git.wolfsden.cz/.git/guix'...
Computing Guix derivation for 'x86_64-linux'... |
/gnu/store/9i597ckynirxy4w5iv2wbmy288vc7gf0-profile
/tmp/repro $ guix build -f x.scm
Updating channel 'guix' from Git repository at 'https://git.wolfsden.cz/.git/guix'...
Computing Guix derivation for 'x86_64-linux'... |
/gnu/store/9i597ckynirxy4w5iv2wbmy288vc7gf0-profile
--8<---------------cut here---------------end--------------->8---
Notice that the work (updating channel & computing the derivation) is
done both times (resulting in the same profile). It is fairly expensive
and, since I am specifying commit, does not seem necessary.
I have tried few variations, including attempting to misuse
cached-channel-instance, (origin (method git-fetch) ...) and few other,
but none ended up with desired result.
So, have can I make guix-for-channels cache the package? Or rather, how
can I get package suitable for guix-configuration (does not have to be
via guix-for-channels) that is cached instead of being built every time?
Maybe something from (guix inferior) would help?
cached-channel-instance seems to do pretty much what I want I presume,
however not sure how to convert store path back into a package (that I
could stuff into guix-configuration's guix field).
Have a nice day,
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]
reply other threads:[~2024-08-24 20:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=87msl1wuzq.fsf@wolfsden.cz \
--to=~@wolfsden.cz \
--cc=guix-devel@gnu.org \
/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).