packages: Use Guile 2.0 for grafting.

Works around <https://bugs.gnu.org/28211>.
Reported by Marius Bakke <mbakke@fastmail.com>.

* guix/packages.scm (guile-2.0): New procedure.
(package-derivation, package-cross-derivation): Use it when computing
the #:guile argument to 'graft-derivation'.
This commit is contained in:
Ludovic Courtès 2017-08-24 00:41:44 +02:00
parent 2718a9cd09
commit e4925e00ca
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 9 additions and 2 deletions

View File

@ -414,6 +414,13 @@ derivations."
(let ((distro (resolve-interface '(gnu packages commencement)))) (let ((distro (resolve-interface '(gnu packages commencement))))
(module-ref distro 'guile-final))) (module-ref distro 'guile-final)))
(define (guile-2.0)
"Return Guile 2.0."
;; FIXME: This is used as a workaround for <https://bugs.gnu.org/28211> when
;; grafting packages.
(let ((distro (resolve-interface '(gnu packages guile))))
(module-ref distro 'guile-2.0)))
(define* (default-guile-derivation #:optional (system (%current-system))) (define* (default-guile-derivation #:optional (system (%current-system)))
"Return the derivation for SYSTEM of the default Guile package used to run "Return the derivation for SYSTEM of the default Guile package used to run
the build code of derivation." the build code of derivation."
@ -1145,7 +1152,7 @@ This is an internal procedure."
(() (()
drv) drv)
(grafts (grafts
(let ((guile (package-derivation store (default-guile) (let ((guile (package-derivation store (guile-2.0)
system #:graft? #f))) system #:graft? #f)))
;; TODO: As an optimization, we can simply graft the tip ;; TODO: As an optimization, we can simply graft the tip
;; of the derivation graph since 'graft-derivation' ;; of the derivation graph since 'graft-derivation'
@ -1171,7 +1178,7 @@ system identifying string)."
(graft-derivation store drv grafts (graft-derivation store drv grafts
#:system system #:system system
#:guile #:guile
(package-derivation store (default-guile) (package-derivation store (guile-2.0)
system #:graft? #f)))) system #:graft? #f))))
drv)))) drv))))