Build new Guix revisions within an inferior
Once inferiors can provide some isolation, this will make building guix in this way safer.
This commit is contained in:
parent
c6949a2710
commit
83832a7862
1 changed files with 24 additions and 11 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
#:use-module (guix inferior)
|
#:use-module (guix inferior)
|
||||||
#:use-module (guix profiles)
|
#:use-module (guix profiles)
|
||||||
#:use-module (guix derivations)
|
#:use-module (guix derivations)
|
||||||
|
#:use-module (guix build utils)
|
||||||
#:use-module (guix-data-service model package)
|
#:use-module (guix-data-service model package)
|
||||||
#:use-module (guix-data-service model guix-revision)
|
#:use-module (guix-data-service model guix-revision)
|
||||||
#:use-module (guix-data-service model guix-revision-package)
|
#:use-module (guix-data-service model guix-revision-package)
|
||||||
|
|
@ -29,17 +30,29 @@
|
||||||
conn packages packages-metadata-ids packages-derivation-ids)))
|
conn packages packages-metadata-ids packages-derivation-ids)))
|
||||||
|
|
||||||
(define (channel->manifest-store-item store channel)
|
(define (channel->manifest-store-item store channel)
|
||||||
(define (build-and-get-output-path store profile-derv)
|
(let ((inferior (open-inferior
|
||||||
(run-with-store store
|
(dirname
|
||||||
(mbegin %store-monad
|
(dirname
|
||||||
(built-derivations (list profile-derv))
|
(which "guix"))))))
|
||||||
(return (derivation->output-path profile-derv)))))
|
(inferior-eval '(use-modules (guix channels)
|
||||||
|
(guix profiles))
|
||||||
(let ((instances (latest-channel-instances store (list channel))))
|
inferior)
|
||||||
(run-with-store store
|
(inferior-eval-with-store
|
||||||
(mlet* %store-monad ((manifest (channel-instances->manifest instances))
|
inferior
|
||||||
(derv (profile-derivation manifest)))
|
store
|
||||||
((store-lift build-and-get-output-path) derv)))))
|
`(lambda (store)
|
||||||
|
(let ((instances (latest-channel-instances
|
||||||
|
store
|
||||||
|
(list (channel (name ',(channel-name channel))
|
||||||
|
(url ,(channel-url channel))
|
||||||
|
(branch ,(channel-branch channel))
|
||||||
|
(commit ,(channel-commit channel)))))))
|
||||||
|
(run-with-store store
|
||||||
|
(mlet* %store-monad ((manifest (channel-instances->manifest instances))
|
||||||
|
(derv (profile-derivation manifest)))
|
||||||
|
(mbegin %store-monad
|
||||||
|
(built-derivations (list derv))
|
||||||
|
(return (derivation->output-path derv))))))))))
|
||||||
|
|
||||||
(define (channel->guix-store-item store channel)
|
(define (channel->guix-store-item store channel)
|
||||||
(dirname
|
(dirname
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue