From: Tomas Volf <~@wolfsden.cz>
To: Nils Landt <nils@landt.email>
Cc: help-guix@gnu.org
Subject: Re: How to use guix-for-channels together with -L without errors?
Date: Thu, 15 Aug 2024 21:46:21 +0200 [thread overview]
Message-ID: <Zr5bDZmXa1c_qs2w@ws> (raw)
In-Reply-To: <883867975.432417.1723742092236@office.mailbox.org>
[-- Attachment #1: Type: text/plain, Size: 2825 bytes --]
On 2024-08-15 19:14:52 +0200, Nils Landt wrote:
> > Tomas Volf <~@wolfsden.cz> hat am 15.08.2024 00:24 CEST geschrieben:
> >
> > Now, what I do not understand is why this error:
> >
> > no code for module (foo)
> >
> > is there. I am building guix from %default-channels, why is it even loading
> > files in the local directory? And how do I make it stop? In this case, I could
> > just drop `-L .', but in real code I need the argument to load modules required
> > for the system.
>
> When that happened to me, it took me forever to find out, so I'm happy to save
> you some pain: The -L adds to the *package* module search path. Guix loads all
> the scm files there to get the package definitions, I'm guessing so there
> doesn't need to be empty modules with a huge "requires" list of every
> package-containing module.
>
> So I put my package definitions in a subdirectory of the channels directory,
> add that subdirectory to GUIX_PACKAGE_PATH, and add the channel root directory
> to GUILE_LOAD_PATH.
Yes! That is it, when I use GUILE_LOAD_PATH instead of -L the errors go away.
Thank you so much. You have saved me so much time. ^_^
Now I have a different problem however. Given a channel list with commits,
hence resolving to the same code every time, it still gets pulled every time,
and Guix derivation computed every time. Illustrated here:
/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
This does not seem necessary (it uses commit, so it does not change) and makes
re-deploys *much* slower. Would you happen to have magical trick for this as
well?
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: 833 bytes --]
next prev parent reply other threads:[~2024-08-15 19:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 22:24 How to use guix-for-channels together with -L without errors? Tomas Volf
2024-08-15 17:14 ` Nils Landt
2024-08-15 19:46 ` Tomas Volf [this message]
2024-08-16 4:40 ` Nils Landt
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=Zr5bDZmXa1c_qs2w@ws \
--to=~@wolfsden.cz \
--cc=help-guix@gnu.org \
--cc=nils@landt.email \
/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.