Try to fix issues with derivations being GC'ed

This commit is contained in:
Christopher Baines 2024-01-19 09:57:19 +00:00
parent a900a1c2ec
commit e0a6c845e5

View file

@ -120,7 +120,8 @@
inf)))
string<?))
(define (all-inferior-system-tests inf store guix-source guix-commit)
(define (all-inferior-system-tests inf store guix-source guix-commit
add-temp-root/long-running-store)
(define inf-systems
(inferior-guix-systems inf))
@ -192,7 +193,8 @@
(for-each (lambda (derivation-file-names-by-system)
(for-each (lambda (derivation-file-name)
(add-temp-root store derivation-file-name))
(add-temp-root/long-running-store
derivation-file-name))
(map cdr derivation-file-names-by-system)))
(map third system-test-data))
@ -1363,8 +1365,21 @@
#:idle-seconds 10
#:destructor (match-lambda
((inferior . store)
(close-inferior inferior)
(close-connection store)))))
;; Don't close the store connection here, because there
;; are temporary roots to keep alive
(close-inferior inferior)))))
(define add-temp-root/long-running-store
(let ((channel (make-channel)))
(spawn-fiber
(lambda ()
(let loop ((filename (get-message channel)))
(add-temp-root store filename)
(loop (get-message channel)))))
(lambda (filename)
(put-message channel filename))))
(simple-format #t "debug: extract-information-from: ~A\n" store-path)
@ -1419,7 +1434,8 @@
((inferior . inferior-store)
(with-time-logging "getting inferior system tests"
(all-inferior-system-tests inferior inferior-store
guix-source commit)))))))
guix-source commit
add-temp-root/long-running-store)))))))
(packages-data
(with-time-logging "getting all inferior package data"
(with-resource-from-pool inf-and-store-pool res