substitute: Work around Guile 2.2 'time-monotonic' bug.

Prior to this change, half of the cached narinfos would expire
immediately since they contained the number of nanoseconds instead of
the number of seconds as their date.

* guix/scripts/substitute.scm (time-monotonic) <guile-2.2>: Define, as a
workaround.
This commit is contained in:
Ludovic Courtès 2017-07-12 21:40:57 +02:00
parent a6c1fe8240
commit b547349d50
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 7 additions and 0 deletions

View File

@ -96,6 +96,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 %narinfo-cache-directory
;; A local cache of narinfos, to avoid going to the network. Most of the
;; time, 'guix substitute' is called by guix-daemon as root and stores its