summaryrefslogtreecommitdiff
path: root/guix/build/graft.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-08-21 22:39:41 +0200
committerLudovic Courtès <ludo@gnu.org>2018-08-24 18:01:05 +0200
commit93c333895a4e2dc9baabec8ade60d9d2ac0a91e2 (patch)
treebcf3902e7435df4334792fa59e5039776ff4bba0 /guix/build/graft.scm
parente4297aa8b95cefa32e2595ce58886fc03b0561f7 (diff)
downloadguix-patches-93c333895a4e2dc9baabec8ade60d9d2ac0a91e2.tar
guix-patches-93c333895a4e2dc9baabec8ade60d9d2ac0a91e2.tar.gz
grafts: Add (guix build debug-link) and use it.
Fixes <https://bugs.gnu.org/19973>. Reported by Mark H Weaver <mhw@netris.org>. * guix/build/debug-link.scm: New file. * guix/build/graft.scm (%graft-hooks): New variable. (graft): Add #:hooks and honor it. * guix/grafts.scm (graft-derivation/shallow): Add (guix build debug-link) and (guix elf) to #:modules. * tests/debug-link.scm: New file. * Makefile.am (MODULES): Add guix/build/debug-link.scm. (SCM_TESTS): Add tests/debug-link.scm.
Diffstat (limited to 'guix/build/graft.scm')
-rw-r--r--guix/build/graft.scm14
1 files changed, 12 insertions, 2 deletions
diff --git a/guix/build/graft.scm b/guix/build/graft.scm
index 8d79e8a50e..c119ee71d1 100644
--- a/guix/build/graft.scm
+++ b/guix/build/graft.scm
@@ -19,6 +19,7 @@
(define-module (guix build graft)
#:use-module (guix build utils)
+ #:use-module (guix build debug-link)
#:use-module (rnrs bytevectors)
#:use-module (ice-9 vlist)
#:use-module (ice-9 match)
@@ -322,8 +323,13 @@ file name pairs."
#:directories? #t))
(rename-matching-files output mapping))
+(define %graft-hooks
+ ;; Default list of hooks run after grafting.
+ (list graft-debug-links))
+
(define* (graft old-outputs new-outputs mapping
- #:key (log-port (current-output-port)))
+ #:key (log-port (current-output-port))
+ (hooks %graft-hooks))
"Apply the grafts described by MAPPING on OLD-OUTPUTS, leading to
NEW-OUTPUTS. MAPPING must be a list of file name pairs; OLD-OUTPUTS and
NEW-OUTPUTS are lists of output name/file name pairs."
@@ -336,6 +342,10 @@ NEW-OUTPUTS are lists of output name/file name pairs."
files))
(match new-outputs
(((names . files) ...)
- files))))
+ files)))
+ (for-each (lambda (hook)
+ (hook old-outputs new-outputs mapping
+ #:log-port log-port))
+ hooks))
;;; graft.scm ends here