aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-03-05 15:52:37 +0100
committerLudovic Courtès <ludo@gnu.org>2020-03-05 16:33:37 +0100
commitf42f39ad68354d19c63222a9630c6e340843aa86 (patch)
treeedb9967c7897e9cdee8f7c7265f59570b7e99c6b
parentc5a3d8f6469f9fb4d47e2d4c84980ab04aedb398 (diff)
downloadguix-f42f39ad68354d19c63222a9630c6e340843aa86.tar.gz
guix-f42f39ad68354d19c63222a9630c6e340843aa86.zip
guix build: Parameterize '%graft?' upfront.
* guix/scripts/build.scm (guix-build): Add 'graft?' variable and parameterize %GRAFT?.
-rw-r--r--guix/scripts/build.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 5c690cb99d..da2a675ce2 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -943,13 +943,21 @@ needed."
(parse-command-line args %options
(list %default-options)))
+ (define graft?
+ (assoc-ref opts 'graft?))
+
(with-error-handling
(with-status-verbosity (assoc-ref opts 'verbosity)
(with-store store
;; Set the build options before we do anything else.
(set-build-options-from-command-line store opts)
- (parameterize ((current-terminal-columns (terminal-columns)))
+ (parameterize ((current-terminal-columns (terminal-columns))
+
+ ;; Set grafting upfront in case the user's input
+ ;; depends on it (e.g., a manifest or code snippet that
+ ;; calls 'gexp->derivation').
+ (%graft? graft?))
(let* ((mode (assoc-ref opts 'build-mode))
(drv (options->derivations store opts))
(urls (map (cut string-append <> "/log")