Stop using profiles for channel instances

Just use the store item instead. This should avoid issues where the profile
gets GC'd.
This commit is contained in:
Christopher Baines 2024-08-27 16:19:03 +01:00
parent a204bda36d
commit 4ab59f46b4

View file

@ -1385,27 +1385,7 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
(derivation-file-name (derivation-file-name
(manifest-entry-item (manifest-entry-item
(first (first
(manifest-entries manifest))))))) (manifest-entries manifest))))))))))))
(profile
. ,(catch #t
(lambda ()
(and manifest
(add-tmp-root-and-return-drv
(derivation-file-name
(parameterize ((%current-system system))
(run-with-store store
(profile-derivation
manifest
#:hooks %channel-profile-hooks)))))))
(lambda (key . args)
(simple-format
(current-error-port)
"error: while computing profile derivation for ~A\n"
system)
(simple-format
(current-error-port)
"error ~A: ~A\n" key args)
#f))))))))
(define (start-inferior inferior-store) (define (start-inferior inferior-store)
(let ((inferior (let ((inferior
@ -1559,16 +1539,11 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
(define (channel-derivations-by-system->guix-store-item (define (channel-derivations-by-system->guix-store-item
channel-derivations-by-system) channel-derivations-by-system)
(define (store-item->guix-store-item filename)
(dirname
(readlink
(string-append filename "/bin"))))
(let ((derivation-file-name-for-current-system (let ((derivation-file-name-for-current-system
(assoc-ref (assoc-ref
(assoc-ref channel-derivations-by-system (assoc-ref channel-derivations-by-system
(%current-system)) (%current-system))
'profile))) 'manifest-entry-item)))
(if derivation-file-name-for-current-system (if derivation-file-name-for-current-system
(let ((derivation-for-current-system (let ((derivation-for-current-system
(read-derivation-from-file derivation-file-name-for-current-system))) (read-derivation-from-file derivation-file-name-for-current-system)))
@ -1578,8 +1553,7 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
(build-derivations store (list derivation-for-current-system))))) (build-derivations store (list derivation-for-current-system)))))
(values (values
(store-item->guix-store-item (derivation->output-path derivation-for-current-system)
(derivation->output-path derivation-for-current-system))
derivation-file-name-for-current-system)) derivation-file-name-for-current-system))
#f))) #f)))