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.