[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
From: |
Ludovic Courtès |
Subject: |
[bug#50960] [PATCH 10/10] shell: Maintain a profile cache. |
Date: |
Sat, 02 Oct 2021 16:12:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Maxime Devos <maximedevos@telenet.be> skribis:
> Ludovic Courtès schreef op za 02-10-2021 om 12:22 [+0200]:
>> With this change, running "guix shell" (no arguments) is equivalent to:
>>
>> guix environment -r ~/.cache/guix/profiles/some-root -l guix.scm
>>
>> This is the cache miss. On cache hit, it's equivalent to:
>>
>> guix environment -p ~/.cache/guix/profiles/some-root
>>
>
> What if guix.scm is something like
>
> ;; Load custom package definitions
> (include "a-package.scm")
> (include "b-package.scm")
> (include "c-package.scm")
> (list a-package b-package c-package bash ...)
>
> and a-package.scm, b-package.scm or c-package.scm is modified?
> Then the cached profile should be rebuild, no?
It should, but it won’t; that’s a weakness of this mtime-based caching
strategy.
I’m not sure how to address it. We’d need a cache key that’s more
precise than inode/mtime, yet cheap to compute.
Perhaps we need to live with that limitation, document it, and provide a
flag to force a rebuild?
> So I think the cache should also check if these dependencies have been
> modified.
> To keep track of the dependencies, something like the ‘compile-all,compile:
> Keep track of dependencies of compiled modules.’ patch from
> <https://issues.guix.gnu.org/50384> could be used, though the 'include',
> 'load',
> 'include-from-path' and maybe 'use-modules' (if something like "guix shell
> -Lextra-modules-directory ..."
> is done) macros would need to be replaced.
Problem is that any attempt to keep track of dependencies is always an
approximation because macros can do anything—I can have my own macro
that reads files at expansion time. So I’m inclined to not even try.
Thanks,
Ludo’.
- [bug#50960] [PATCH 04/10] DRAFT shell: By default load the local 'guix.scm' or 'manifest.scm' file., (continued)
- [bug#50960] [PATCH 08/10] environment: Autoload some modules., Ludovic Courtès, 2021/10/02
- [bug#50960] [PATCH 05/10] environment: Add tests for '--profile'., Ludovic Courtès, 2021/10/02
- [bug#50960] [PATCH 07/10] environment: Do not connect to the daemon when '--profile' is used., Ludovic Courtès, 2021/10/02
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., Ludovic Courtès, 2021/10/02
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., Maxime Devos, 2021/10/02
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.,
Ludovic Courtès <=
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., Maxime Devos, 2021/10/02
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., Ludovic Courtès, 2021/10/04
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., zimoun, 2021/10/04
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., Maxime Devos, 2021/10/04
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., Ludovic Courtès, 2021/10/08
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., Maxime Devos, 2021/10/02
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., Ludovic Courtès, 2021/10/02
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., Maxime Devos, 2021/10/02
- [bug#50960] [PATCH 10/10] shell: Maintain a profile cache., Ludovic Courtès, 2021/10/04
[bug#50960] [PATCH 09/10] cache: Gracefully handle non-existent cache., Ludovic Courtès, 2021/10/02