aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-03-28 20:41:05 +0000
committerChristopher Baines <mail@cbaines.net>2019-03-28 20:41:05 +0000
commit76d6027b7c84abe80b57f589174efcffbe19fc69 (patch)
treec5b238971b0c54084231bcff3f3aabd091bf05d7
parent0c6c413804eb0b7da5548b44e20f3b4ab6197132 (diff)
downloaddata-service-76d6027b7c84abe80b57f589174efcffbe19fc69.tar
data-service-76d6027b7c84abe80b57f589174efcffbe19fc69.tar.gz
Try to handle the guix store item being garbage collected
-rw-r--r--guix-data-service/jobs/load-new-guix-revision.scm23
1 files changed, 17 insertions, 6 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm
index fec3a7d..071457e 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -170,12 +170,23 @@
package
'package-transitive-supported-systems))
-(define (guix-store-path store)
- (let* ((guix-package (@ (gnu packages package-management)
- guix))
- (derivation (package-derivation store guix-package)))
- (build-derivations store (list derivation))
- (derivation->output-path derivation)))
+(define guix-store-path
+ (let ((store-path #f))
+ (lambda (store)
+ (if (and store-path
+ (file-exists? store-path))
+ store-path
+ (begin
+ (invalidate-derivation-caches!)
+ (let* ((guix-package (@ (gnu packages package-management)
+ guix))
+ (derivation (package-derivation store guix-package)))
+ (build-derivations store (list derivation))
+
+ (let ((new-store-path
+ (derivation->output-path derivation)))
+ (set! store-path new-store-path)
+ new-store-path)))))))
(define (nss-certs-store-path store)
(let* ((nss-certs-package (@ (gnu packages certs)