mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-23 21:17:11 -05:00
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.
This commit is contained in:
parent
8a8e2d2ed5
commit
25a49294ca
3 changed files with 16 additions and 3 deletions
|
@ -142,9 +142,8 @@ (define* (store-path-abbreviation store-path #:optional (prefix-length 6))
|
|||
|
||||
(cond-expand
|
||||
(guile-2.2
|
||||
;; Guile 2.2.0 to 2.2.2 included has a bug whereby 'time-monotonic' objects
|
||||
;; have seconds and nanoseconds swapped (fixed in Guile commit 886ac3e).
|
||||
;; Work around it.
|
||||
;; 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))
|
||||
|
||||
|
|
|
@ -33,6 +33,13 @@ (define-module (guix cache)
|
|||
;;;
|
||||
;;; 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))
|
||||
|
|
|
@ -24,6 +24,13 @@ (define-module (test-cache)
|
|||
#:use-module ((guix utils) #:select (call-with-temporary-directory))
|
||||
#:use-module (ice-9 match))
|
||||
|
||||
(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))
|
||||
|
||||
(test-begin "cache")
|
||||
|
||||
(test-equal "remove-expired-cache-entries"
|
||||
|
|
Loading…
Reference in a new issue