From 76d6027b7c84abe80b57f589174efcffbe19fc69 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 28 Mar 2019 20:41:05 +0000 Subject: Try to handle the guix store item being garbage collected --- guix-data-service/jobs/load-new-guix-revision.scm | 23 +++++++++++++++++------ 1 file 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) -- cgit v1.2.3