guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ludovic Courtès
Subject: 03/03: substitute: Work around Guile 2.2 'time-monotonic' bug.
Date: Wed, 12 Jul 2017 16:07:04 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit b547349d505c57fd679b6e48c472d8ab65469c96
Author: Ludovic Courtès <address@hidden>
Date:   Wed Jul 12 21:40:57 2017 +0200

    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.
---
 guix/scripts/substitute.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 71f3003..9348599 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]