aboutsummaryrefslogtreecommitdiff
path: root/guix/cache.scm
Commit message (Collapse)AuthorAge
* cache: 'file-expiration-time' uses 'lstat', not 'stat'.Ludovic Courtès2023-07-11
| | | | | | | | | | Fixes a bug whereby 'cached-channel-instance' would potentially consider cache entries obsolete too early because they refer to items in the store, which is mounted as 'noatime' on Guix System. * guix/cache.scm (file-expiration-time): Use 'lstat' and 'false-if-exception' rather than 'stat'. This matches what (guix scripts shell) does.
* cache: Catch invalid 'last-expiry-cleanup'.zimoun2022-06-04
| | | | | | | | | | | | Fixes <http://issues.guix.gnu.org/55638>. * guix/cache.scm (maybe-remove-expired-cache-entries)[last-expiry-date]: Use 'get-string-all' + 'string->number' instead of 'read'; ignore invalid numbers. * tests/cache.scm ("maybe-remove-expired-cache-entries, empty cache") ("maybe-remove-expired-cache-entries, corrupted cache"): New tests. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* cache: Gracefully handle non-existent cache.Ludovic Courtès2021-10-25
| | | | | * guix/cache.scm (maybe-remove-expired-cache-entries): Ignore ENOENT when writing EXPIRY-FILE.
* git: Periodically delete least-recently-used cached checkouts.Ludovic Courtès2021-01-13
| | | | | | | | | | | | This ensures ~/.cache/guix/checkouts is periodically cleaned up. * guix/git.scm (cached-checkout-expiration) (%checkout-cache-cleanup-period): New variables. (delete-checkout): New procedure. (update-cached-checkout)[cache-entries]: New procedure. Add call to 'maybe-remove-expired-cache-entries'. * guix/cache.scm (file-expiration-time): Add optional 'timestamp' parameter and honor it.
* Remove workaround for 'time-monotonic' in Guile 2.2.2.Ludovic Courtès2020-03-22
| | | | | | | | | | | | This is a followup to e688c2df3924423b67892cc9939ca099c729d1cb. * build-aux/hydra/evaluate.scm <top level>: Remove 'time-monotonic' definition. * guix/cache.scm: Likewise. * guix/progress.scm: Likewise. * guix/scripts/substitute.scm: Likewise. * guix/scripts/weather.scm: Likewise. * tests/cache.scm: Likewise.
* cache: Work around 'time-monotonic' bug in Guile 2.2.2.Ludovic Courtès2017-04-22
| | | | | | | * guix/cache.scm (time-monotonic) [guile-2.2]: New variable. * tests/cache.scm (time-monotonic) [guile-2.2]: Likewise. * guix/build/download.scm (time-monotonic) [guile-2.2]: Adjust comment: it's a 2.2.2 bug.
* Add (guix cache) and use it in (guix scripts substitute).Ludovic Courtès2017-04-18
* guix/cache.scm, tests/cache.scm: New files. * Makefile.am (MODULES, SCM_TESTS): Add them. * guix/scripts/substitute.scm (obsolete?): Remove. (remove-expired-cached-narinfos): Rename to... (cached-narinfo-expiration-time): ... this. Remove the removal part and only keep the expiration time part. (narinfo-cache-directories): Add optional 'directory' parameter and honor it. (maybe-remove-expired-cached-narinfo): Remove. (cached-narinfo-files): New procedure. (guix-substitute): Use 'maybe-remove-expired-cache-entries' instead of 'maybe-remove-expired-cached-narinfo'.