diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index fbc7a59a03..7eb3567f25 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -44,7 +44,7 @@ ;;; Commentary: ;;; -;;; This modules provides tools to build tarballs of the "bootstrap binaries" +;;; This module provides tools to build tarballs of the "bootstrap binaries" ;;; used in (gnu packages bootstrap). These statically-linked binaries are ;;; taken for granted and used as the root of the whole bootstrap procedure. ;;; @@ -511,8 +511,10 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (let () (use-modules (guix build utils)) - (let ((in (assoc-ref %build-inputs "guile")) - (out (assoc-ref %outputs "out"))) + (let* ((in (assoc-ref %build-inputs "guile")) + (out (assoc-ref %outputs "out")) + (guile1 (string-append in "/bin/guile")) + (guile2 (string-append out "/bin/guile"))) (mkdir-p (string-append out "/share/guile/2.0")) (copy-recursively (string-append in "/share/guile/2.0") (string-append out "/share/guile/2.0")) @@ -522,10 +524,23 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (string-append out "/lib/guile/2.0/ccache")) (mkdir (string-append out "/bin")) - (copy-file (string-append in "/bin/guile") - (string-append out "/bin/guile")) - (remove-store-references (string-append out "/bin/guile")) - #t)))) + (copy-file guile1 guile2) + + ;; Does the relocated Guile work? + (and ,(if (%current-target-system) + #t + '(zero? (system* guile2 "--version"))) + (begin + ;; Strip store references. + (remove-store-references guile2) + + ;; Does the stripped Guile work? If it aborts, it could be + ;; that it tries to open iconv descriptors and fails because + ;; libc's iconv data isn't available (see + ;; `guile-default-utf8.patch'.) + ,(if (%current-target-system) + #t + '(zero? (system* guile2 "--version"))))))))) (inputs `(("guile" ,%guile-static))) (outputs '("out"))))