me
/
guix
Archived
1
0
Fork 0

environment: Skip derivation computation when '--profile' is used.

* guix/scripts/environment.scm (guix-environment*): Bypass calls to
'package-derivation' and to 'manifest->derivation' when PROFILE is
true.
master
Ludovic Courtès 2021-10-01 18:59:54 +02:00
parent 10208952ea
commit 648a6eb03f
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 13 additions and 10 deletions

View File

@ -729,18 +729,21 @@ command-line option processing with 'parse-command-line'."
;; Use the bootstrap Guile when requested. ;; Use the bootstrap Guile when requested.
(parameterize ((%graft? (assoc-ref opts 'graft?)) (parameterize ((%graft? (assoc-ref opts 'graft?))
(%guile-for-build (%guile-for-build
(package-derivation (and (or container? (not profile))
store (package-derivation
(if bootstrap? store
%bootstrap-guile (if bootstrap?
(default-guile))))) %bootstrap-guile
(default-guile))))))
(run-with-store store (run-with-store store
;; Containers need a Bourne shell at /bin/sh. ;; Containers need a Bourne shell at /bin/sh.
(mlet* %store-monad ((bash (environment-bash container? (mlet* %store-monad ((bash (environment-bash container?
bootstrap? bootstrap?
system)) system))
(prof-drv (manifest->derivation (prof-drv (if profile
manifest system bootstrap?)) (return #f)
(manifest->derivation
manifest system bootstrap?)))
(profile -> (if profile (profile -> (if profile
(readlink* profile) (readlink* profile)
(derivation->output-path prof-drv))) (derivation->output-path prof-drv)))
@ -750,9 +753,9 @@ command-line option processing with 'parse-command-line'."
;; --search-paths. Additionally, we might need to build bash for ;; --search-paths. Additionally, we might need to build bash for
;; a container. ;; a container.
(mbegin %store-monad (mbegin %store-monad
(built-derivations (if (derivation? bash) (built-derivations (append
(list prof-drv bash) (if prof-drv (list prof-drv) '())
(list prof-drv))) (if (derivation? bash) (list bash) '())))
(mwhen gc-root (mwhen gc-root
(register-gc-root profile gc-root)) (register-gc-root profile gc-root))