environment: Parameterize ‘%graft?’ early on.

Previously, ‘%graft?’ would be parameterized after ‘package-derivation’
had been called for ‘%guile-for-build’, which is too late.

* guix/scripts/environment.scm (guix-environment*)[with-store/maybe]:
Parameterize ‘%graft?’.
Remove ‘%graft?’ parameterization from body.

Change-Id: I65ef4a8c5f27e19a49196005871e5f7057fabaec
This commit is contained in:
Ludovic Courtès 2023-10-28 01:21:56 +02:00
parent 344e39c928
commit 661672a7f8
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 13 additions and 13 deletions

View File

@ -1100,17 +1100,18 @@ command-line option processing with 'parse-command-line'."
;; Evaluate EXP... with STORE bound to a connection, unless ;; Evaluate EXP... with STORE bound to a connection, unless
;; STORE-NEEDED? is false, in which case STORE is bound to #f. ;; STORE-NEEDED? is false, in which case STORE is bound to #f.
(let ((proc (lambda (store) exp ...))) (let ((proc (lambda (store) exp ...)))
(if store-needed? (parameterize ((%graft? (assoc-ref opts 'graft?)))
(with-store s (if store-needed?
(set-build-options-from-command-line s opts) (with-store s
(with-build-handler (build-notifier #:use-substitutes? (set-build-options-from-command-line s opts)
(assoc-ref opts 'substitutes?) (with-build-handler (build-notifier #:use-substitutes?
#:verbosity (assoc-ref opts 'substitutes?)
(assoc-ref opts 'verbosity) #:verbosity
#:dry-run? (assoc-ref opts 'verbosity)
(assoc-ref opts 'dry-run?)) #:dry-run?
(proc s))) (assoc-ref opts 'dry-run?))
(proc #f)))) (proc s)))
(proc #f)))))
(when container? (assert-container-features)) (when container? (assert-container-features))
@ -1146,8 +1147,7 @@ command-line option processing with 'parse-command-line'."
(warning (G_ "no packages specified; creating an empty environment~%"))) (warning (G_ "no packages specified; creating an empty environment~%")))
;; Use the bootstrap Guile when requested. ;; Use the bootstrap Guile when requested.
(parameterize ((%graft? (assoc-ref opts 'graft?)) (parameterize ((%guile-for-build
(%guile-for-build
(and store-needed? (and store-needed?
(package-derivation (package-derivation
store store