Hello Tomas! Tomas Volf <[email protected]> skribis:
>> It’s a feature: use of ‘-L’ or ‘GUIX_PACKAGE_PATH’ disables caching. >> >> This is because in that case what the manifest and command line refer to >> is “uncontrolled”. > > Is this feature documented somewhere? Manual page `Invoking guix shell' > either does not mention this or I cannot find it (both is possible ^_^). > > And follow-up question, is there a way to work around this feature, > possibly via a command-line option? I have to admit that having 2s > penalty on every guix shell invocation is somewhat frustrating. Caching is not documented, it’s an “implementation detail”. There’s no way to force the use of the cache (this could be bad since one could easily end up caching nonsensical results). Maybe you can use a channel instead of -L? >> For the same reason, ‘./pre-inst-env guix shell x y z’ in a checkout >> does not benefit from caching. >> >> See uses of ‘cache-is-authoritative?’ in guix/scripts/shell.scm. > > Thank you for the pointer, I will try to dig around a bit. This seems > to talk about package cache, which is used for the specifications > resolving, correct? Does it have other uses? Because even when I > rewrite the manifest to uses packages->manifest, the shell command is > still not caching. Is the package cache used even for > packages->manifest? I lack knowledge in this area. The package cache is used to map package specs (name or name+version) to variables (like “make” -> (@ (gnu packages base) make)). ‘cache-is-authoritative?’ essentially checks that you’re running from a channel without anything that could interfere: no ‘-L’, no ‘GUIX_PACKAGE_PATH’. That’s the only case where we can safely use the package cache and, more generally, cache anything that touches packages. HTH! Ludo’.
