aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-10-01 18:59:54 +0200
committerLudovic Courtès <ludo@gnu.org>2021-10-25 19:02:33 +0200
commit648a6eb03fddb6c67f0ec685ac74d2c7a82179cd (patch)
tree6ccc59b341cba72b451b11f7ec97a67b2719c1eb
parent10208952eaf0834b9cdf341bc75463ed033af315 (diff)
downloadguix-648a6eb03fddb6c67f0ec685ac74d2c7a82179cd.tar.gz
guix-648a6eb03fddb6c67f0ec685ac74d2c7a82179cd.zip
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.
-rw-r--r--guix/scripts/environment.scm23
1 files changed, 13 insertions, 10 deletions
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 77956fc018..32f376fdd2 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -729,18 +729,21 @@ command-line option processing with 'parse-command-line'."
;; Use the bootstrap Guile when requested.
(parameterize ((%graft? (assoc-ref opts 'graft?))
(%guile-for-build
- (package-derivation
- store
- (if bootstrap?
- %bootstrap-guile
- (default-guile)))))
+ (and (or container? (not profile))
+ (package-derivation
+ store
+ (if bootstrap?
+ %bootstrap-guile
+ (default-guile))))))
(run-with-store store
;; Containers need a Bourne shell at /bin/sh.
(mlet* %store-monad ((bash (environment-bash container?
bootstrap?
system))
- (prof-drv (manifest->derivation
- manifest system bootstrap?))
+ (prof-drv (if profile
+ (return #f)
+ (manifest->derivation
+ manifest system bootstrap?)))
(profile -> (if profile
(readlink* profile)
(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
;; a container.
(mbegin %store-monad
- (built-derivations (if (derivation? bash)
- (list prof-drv bash)
- (list prof-drv)))
+ (built-derivations (append
+ (if prof-drv (list prof-drv) '())
+ (if (derivation? bash) (list bash) '())))
(mwhen gc-root
(register-gc-root profile gc-root))