aboutsummaryrefslogtreecommitdiff
path: root/guix/cache.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-04-22 14:40:51 +0200
committerLudovic Courtès <ludo@gnu.org>2017-04-22 14:42:15 +0200
commit25a49294caf2386e65fc1b12a2508324be0b1cc2 (patch)
treed8093fb4de2ea7400d7064c3531bde94d8dd4b2f /guix/cache.scm
parent8a8e2d2ed5932a13a73583d32b152133d28aedf5 (diff)
downloadguix-25a49294caf2386e65fc1b12a2508324be0b1cc2.tar
guix-25a49294caf2386e65fc1b12a2508324be0b1cc2.tar.gz
cache: Work around 'time-monotonic' bug in Guile 2.2.2.
* 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.
Diffstat (limited to 'guix/cache.scm')
-rw-r--r--guix/cache.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/guix/cache.scm b/guix/cache.scm
index 077b0780bd..1dc0083f1d 100644
--- a/guix/cache.scm
+++ b/guix/cache.scm
@@ -33,6 +33,13 @@
;;;
;;; Code:
+(cond-expand
+ (guile-2.2
+ ;; Guile 2.2.2 has a bug whereby 'time-monotonic' objects have seconds and
+ ;; nanoseconds swapped (fixed in Guile commit 886ac3e). Work around it.
+ (define time-monotonic time-tai))
+ (else #t))
+
(define (obsolete? date now ttl)
"Return #t if DATE is obsolete compared to NOW + TTL seconds."
(time>? (subtract-duration now (make-time time-duration 0 ttl))