[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
28/29: grafts: Add 'without-grafting'.
From: |
guix-commits |
Subject: |
28/29: grafts: Add 'without-grafting'. |
Date: |
Mon, 8 Mar 2021 06:24:56 -0500 (EST) |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit 231afd7a967632b6da31983fb4d7844812ef3ba1
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Mar 7 15:26:17 2021 +0100
grafts: Add 'without-grafting'.
* guix/grafts.scm (call-without-grafting): New procedure.
(without-grafting): New macro.
---
guix/grafts.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/guix/grafts.scm b/guix/grafts.scm
index fd8a108..7f5b97c 100644
--- a/guix/grafts.scm
+++ b/guix/grafts.scm
@@ -42,6 +42,7 @@
graft-derivation/shallow
%graft?
+ without-grafting
set-grafting
grafting?))
@@ -323,6 +324,17 @@ DRV, and graft DRV itself to refer to those grafted
dependencies."
;; Whether to honor package grafts by default.
(make-parameter #t))
+(define (call-without-grafting thunk)
+ (lambda (store)
+ (values (parameterize ((%graft? #f))
+ (run-with-store store (thunk)))
+ store)))
+
+(define-syntax-rule (without-grafting mexp ...)
+ "Bind monadic expressions MEXP in a dynamic extent where '%graft?' is
+false."
+ (call-without-grafting (lambda () (mbegin %store-monad mexp ...))))
+
(define-inlinable (set-grafting enable?)
;; This monadic procedure enables grafting when ENABLE? is true, and
;; disables it otherwise. It returns the previous setting.
- 01/29: store: Object cache profiling shows the number of entries., (continued)
- 01/29: store: Object cache profiling shows the number of entries., guix-commits, 2021/03/08
- 06/29: gexp: 'gexp-inputs' returns a list of <gexp-input> records., guix-commits, 2021/03/08
- 07/29: gexp: 'gexp-inputs' returns both native and non-native inputs., guix-commits, 2021/03/08
- 11/29: gexp: Reduce allocations in 'gexp-attribute'., guix-commits, 2021/03/08
- 09/29: gexp: Micro-optimize 'gexp->sexp' and 'lower-inputs'., guix-commits, 2021/03/08
- 13/29: gexp: Optimize 'with-build-variables'., guix-commits, 2021/03/08
- 10/29: gexp: Reduce allocations while traversing lists., guix-commits, 2021/03/08
- 20/29: build-system: Use 'sexp->gexp' for plain sexps., guix-commits, 2021/03/08
- 21/29: build-system: Use 'input-tuples->gexp' and 'outputs->gexp'., guix-commits, 2021/03/08
- 02/29: store: Micro-optimize object cache lookup., guix-commits, 2021/03/08
- 28/29: grafts: Add 'without-grafting'.,
guix-commits <=
- 29/29: gexp: Allowed/disallowed references and graphs never refer to grafted inputs., guix-commits, 2021/03/08
- 14/29: build-system: Rewrite using gexps., guix-commits, 2021/03/08
- 15/29: packages: Turn 'bag->derivation' into a monadic procedure., guix-commits, 2021/03/08
- 16/29: packages: Simplify patch instantiation., guix-commits, 2021/03/08
- 25/29: tests: Refer to '%derivation-cache' in the right module., guix-commits, 2021/03/08
- 26/29: packages: 'expand-input' accepts any file-like object., guix-commits, 2021/03/08
- 17/29: packages: Core procedures are written in monadic style., guix-commits, 2021/03/08
- 19/29: gexp: Add 'sexp->gexp'., guix-commits, 2021/03/08
- 05/29: gexp: Micro-optimize sexp serialization., guix-commits, 2021/03/08
- 12/29: gexp: Add 'with-build-variables'., guix-commits, 2021/03/08