bootstrap: %bootstrap-inputs: Wrap input lists into thunks.

* gnu/packages/bootstrap.scm (%bootstrap-inputs): Change to procedure.  Update
users; prepares for Mes bootstrap.
* gnu/packages/commencement.scm (%boot0-inputs, %boot1-inputs, %boot2-inputs,
%boot3-inputs, %boot4-inputs, %boot5-inputs, %boot-6-inputs): Change to
procedure.  Update users.
* tests/builders.scm (%bootstrap-inputs, %bootstrap-search-paths): Make a
procedure, filter on package?.  Update users.
This commit is contained in:
Jan Nieuwenhuizen 2018-09-09 11:54:27 +02:00
parent 985d542e02
commit a2b2070b67
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
6 changed files with 81 additions and 74 deletions

View File

@ -586,7 +586,7 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
(home-page #f) (home-page #f)
(license gpl3+))) (license gpl3+)))
(define %bootstrap-inputs (define (%bootstrap-inputs)
;; The initial, pre-built inputs. From now on, we can start building our ;; The initial, pre-built inputs. From now on, we can start building our
;; own packages. ;; own packages.
`(("libc" ,%bootstrap-glibc) `(("libc" ,%bootstrap-glibc)

View File

@ -5,6 +5,7 @@
;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014, 2015, 2017 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -100,13 +101,13 @@
(install-file "make" bin) (install-file "make" bin)
#t)))))))) #t))))))))
(native-inputs '()) ; no need for 'pkg-config' (native-inputs '()) ; no need for 'pkg-config'
(inputs %bootstrap-inputs)))) (inputs (%bootstrap-inputs)))))
(define diffutils-boot0 (define diffutils-boot0
(package-with-bootstrap-guile (package-with-bootstrap-guile
(let ((p (package-with-explicit-inputs diffutils (let ((p (package-with-explicit-inputs diffutils
`(("make" ,gnu-make-boot0) `(("make" ,gnu-make-boot0)
,@%bootstrap-inputs) ,@(%bootstrap-inputs))
#:guile %bootstrap-guile))) #:guile %bootstrap-guile)))
(package (inherit p) (package (inherit p)
(name "diffutils-boot0") (name "diffutils-boot0")
@ -120,7 +121,7 @@
(name "findutils-boot0")) (name "findutils-boot0"))
`(("make" ,gnu-make-boot0) `(("make" ,gnu-make-boot0)
("diffutils" ,diffutils-boot0) ; for tests ("diffutils" ,diffutils-boot0) ; for tests
,@%bootstrap-inputs) ,@(%bootstrap-inputs))
(current-source-location) (current-source-location)
#:guile %bootstrap-guile))) #:guile %bootstrap-guile)))
@ -130,17 +131,17 @@
(inherit file) (inherit file)
(name "file-boot0")) (name "file-boot0"))
`(("make" ,gnu-make-boot0) `(("make" ,gnu-make-boot0)
,@%bootstrap-inputs) ,@(%bootstrap-inputs))
(current-source-location) (current-source-location)
#:guile %bootstrap-guile))) #:guile %bootstrap-guile)))
(define %boot0-inputs (define (%boot0-inputs)
`(("make" ,gnu-make-boot0) `(("make" ,gnu-make-boot0)
("diffutils" ,diffutils-boot0) ("diffutils" ,diffutils-boot0)
("findutils" ,findutils-boot0) ("findutils" ,findutils-boot0)
("file" ,file-boot0) ("file" ,file-boot0)
,@%bootstrap-inputs)) ,@(%bootstrap-inputs)))
(define* (boot-triplet #:optional (system (%current-system))) (define* (boot-triplet #:optional (system (%current-system)))
;; Return the triplet used to create the cross toolchain needed in the ;; Return the triplet used to create the cross toolchain needed in the
@ -149,7 +150,7 @@
;; Following Linux From Scratch, build a cross-toolchain in stage 0. That ;; Following Linux From Scratch, build a cross-toolchain in stage 0. That
;; toolchain actually targets the same OS and arch, but it has the advantage ;; toolchain actually targets the same OS and arch, but it has the advantage
;; of being independent of the libc and tools in %BOOTSTRAP-INPUTS, since ;; of being independent of the libc and tools in (%BOOTSTRAP-INPUTS), since
;; GCC-BOOT0 (below) is built without any reference to the target libc. ;; GCC-BOOT0 (below) is built without any reference to the target libc.
(define binutils-boot0 (define binutils-boot0
@ -184,7 +185,7 @@
((#:configure-flags cf) ((#:configure-flags cf)
`(cons ,(string-append "--target=" (boot-triplet)) `(cons ,(string-append "--target=" (boot-triplet))
,cf))))) ,cf)))))
(inputs %boot0-inputs)))) (inputs (%boot0-inputs)))))
;; Use a "fixed" package source for this early libstdc++ variant so we can ;; Use a "fixed" package source for this early libstdc++ variant so we can
;; update GCC 4.9 without triggering a full rebuild. ;; update GCC 4.9 without triggering a full rebuild.
@ -216,7 +217,7 @@
#:validate-runpath? #f #:validate-runpath? #f
,@(package-arguments lib))) ,@(package-arguments lib)))
(inputs %boot0-inputs) (inputs (%boot0-inputs))
(native-inputs '())))) (native-inputs '()))))
(define gcc-boot0 (define gcc-boot0
@ -307,8 +308,8 @@
;; Call it differently so that the builder can check whether ;; Call it differently so that the builder can check whether
;; the "libc" input is #f. ;; the "libc" input is #f.
("libc-native" ,@(assoc-ref %boot0-inputs "libc")) ("libc-native" ,@(assoc-ref (%boot0-inputs) "libc"))
,@(alist-delete "libc" %boot0-inputs))) ,@(alist-delete "libc" (%boot0-inputs))))
;; No need for the native-inputs to build the documentation at this stage. ;; No need for the native-inputs to build the documentation at this stage.
(native-inputs `())))) (native-inputs `()))))
@ -338,7 +339,7 @@
`(delete "-Dusethreads" ,configure-flags)))))))) `(delete "-Dusethreads" ,configure-flags))))))))
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs perl (package-with-explicit-inputs perl
%boot0-inputs (%boot0-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile)))) #:guile %bootstrap-guile))))
@ -347,7 +348,7 @@
;; It is also needed to rebuild Bash's parser, which is modified by ;; It is also needed to rebuild Bash's parser, which is modified by
;; its CVE patches. Remove it when it's no longer needed. ;; its CVE patches. Remove it when it's no longer needed.
(let* ((m4 (package-with-bootstrap-guile (let* ((m4 (package-with-bootstrap-guile
(package-with-explicit-inputs m4 %boot0-inputs (package-with-explicit-inputs m4 (%boot0-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile))) #:guile %bootstrap-guile)))
(bison (package (inherit bison) (bison (package (inherit bison)
@ -363,7 +364,7 @@
"V=1")))))) "V=1"))))))
(package (package
(inherit (package-with-bootstrap-guile (inherit (package-with-bootstrap-guile
(package-with-explicit-inputs bison %boot0-inputs (package-with-explicit-inputs bison (%boot0-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile))) #:guile %bootstrap-guile)))
(native-inputs `(("perl" ,perl-boot0)))))) (native-inputs `(("perl" ,perl-boot0))))))
@ -376,7 +377,7 @@
(inputs `(("indent" ,indent))) (inputs `(("indent" ,indent)))
(arguments '(#:tests? #f))))) (arguments '(#:tests? #f)))))
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs flex %boot0-inputs (package-with-explicit-inputs flex (%boot0-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile)))) #:guile %bootstrap-guile))))
@ -394,12 +395,12 @@
,@(package-arguments linux-libre-headers))) ,@(package-arguments linux-libre-headers)))
(native-inputs (native-inputs
`(("perl" ,perl-boot0) `(("perl" ,perl-boot0)
,@%boot0-inputs)))))) ,@(%boot0-inputs)))))))
(define gnumach-headers-boot0 (define gnumach-headers-boot0
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs gnumach-headers (package-with-explicit-inputs gnumach-headers
%boot0-inputs (%boot0-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile))) #:guile %bootstrap-guile)))
@ -413,7 +414,7 @@
`(,(string-append "LDFLAGS=-Wl,-rpath=" `(,(string-append "LDFLAGS=-Wl,-rpath="
(assoc-ref %build-inputs "flex") "/lib/"))))))) (assoc-ref %build-inputs "flex") "/lib/")))))))
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs mig %boot0-inputs (package-with-explicit-inputs mig (%boot0-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile)))) #:guile %bootstrap-guile))))
@ -422,7 +423,7 @@
(native-inputs `(("mig" ,mig-boot0))) (native-inputs `(("mig" ,mig-boot0)))
(inputs '())))) (inputs '()))))
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs hurd-headers %boot0-inputs (package-with-explicit-inputs hurd-headers (%boot0-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile)))) #:guile %bootstrap-guile))))
@ -431,7 +432,7 @@
(native-inputs `(("mig" ,mig-boot0))) (native-inputs `(("mig" ,mig-boot0)))
(inputs '())))) (inputs '()))))
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs hurd-minimal %boot0-inputs (package-with-explicit-inputs hurd-minimal (%boot0-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile)))) #:guile %bootstrap-guile))))
@ -447,7 +448,7 @@ the bootstrap environment."
`(("gnumach-headers" ,gnumach-headers-boot0) `(("gnumach-headers" ,gnumach-headers-boot0)
("hurd-headers" ,hurd-headers-boot0) ("hurd-headers" ,hurd-headers-boot0)
("hurd-minimal" ,hurd-minimal-boot0) ("hurd-minimal" ,hurd-minimal-boot0)
,@%boot0-inputs)))))) ,@(%boot0-inputs)))))))
(define* (kernel-headers-boot0 #:optional (system (%current-system))) (define* (kernel-headers-boot0 #:optional (system (%current-system)))
(match system (match system
@ -458,7 +459,7 @@ the bootstrap environment."
;; Texinfo used to build libc's manual. ;; Texinfo used to build libc's manual.
;; We build without ncurses because it fails to build at this stage, and ;; We build without ncurses because it fails to build at this stage, and
;; because we don't need the stand-alone Info reader. ;; because we don't need the stand-alone Info reader.
;; Also, use %BOOT0-INPUTS to avoid building Perl once more. ;; Also, use (%BOOT0-INPUTS) to avoid building Perl once more.
(let ((texinfo (package (inherit texinfo) (let ((texinfo (package (inherit texinfo)
(native-inputs '()) (native-inputs '())
(inputs `(("perl" ,perl-boot0))) (inputs `(("perl" ,perl-boot0)))
@ -468,7 +469,7 @@ the bootstrap environment."
;; UTF-8 locale at this stage, so skip them. ;; UTF-8 locale at this stage, so skip them.
(arguments '(#:tests? #f))))) (arguments '(#:tests? #f)))))
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs texinfo %boot0-inputs (package-with-explicit-inputs texinfo (%boot0-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile)))) #:guile %bootstrap-guile))))
@ -479,14 +480,14 @@ the bootstrap environment."
#:target boot-triplet #:target boot-triplet
#:binutils binutils-boot0 #:binutils binutils-boot0
#:guile %bootstrap-guile #:guile %bootstrap-guile
#:bash (car (assoc-ref %boot0-inputs "bash")))) #:bash (car (assoc-ref (%boot0-inputs) "bash"))))
(define %boot1-inputs (define (%boot1-inputs)
;; 2nd stage inputs. ;; 2nd stage inputs.
`(("gcc" ,gcc-boot0) `(("gcc" ,gcc-boot0)
("ld-wrapper-cross" ,ld-wrapper-boot0) ("ld-wrapper-cross" ,ld-wrapper-boot0)
("binutils-cross" ,binutils-boot0) ("binutils-cross" ,binutils-boot0)
,@(alist-delete "binutils" %boot0-inputs))) ,@(alist-delete "binutils" (%boot0-inputs))))
(define glibc-final-with-bootstrap-bash (define glibc-final-with-bootstrap-bash
;; The final libc, "cross-built". If everything went well, the resulting ;; The final libc, "cross-built". If everything went well, the resulting
@ -542,7 +543,7 @@ the bootstrap environment."
(inputs (inputs
`(;; The boot inputs. That includes the bootstrap libc. We don't want `(;; The boot inputs. That includes the bootstrap libc. We don't want
;; it in $CPATH, hence the 'pre-configure' phase above. ;; it in $CPATH, hence the 'pre-configure' phase above.
,@%boot1-inputs ,@(%boot1-inputs)
;; A native MiG is needed to build Glibc on Hurd. ;; A native MiG is needed to build Glibc on Hurd.
,@(if (hurd-triplet? (%current-system)) ,@(if (hurd-triplet? (%current-system))
@ -550,11 +551,11 @@ the bootstrap environment."
'()) '())
;; A native GCC is needed to build `cross-rpcgen'. ;; A native GCC is needed to build `cross-rpcgen'.
("native-gcc" ,@(assoc-ref %boot0-inputs "gcc")) ("native-gcc" ,@(assoc-ref (%boot0-inputs) "gcc"))
;; Here, we use the bootstrap Bash, which is not satisfactory ;; Here, we use the bootstrap Bash, which is not satisfactory
;; because we don't want to depend on bootstrap tools. ;; because we don't want to depend on bootstrap tools.
("static-bash" ,@(assoc-ref %boot0-inputs "bash"))))))) ("static-bash" ,@(assoc-ref (%boot0-inputs) "bash")))))))
(define (cross-gcc-wrapper gcc binutils glibc bash) (define (cross-gcc-wrapper gcc binutils glibc bash)
"Return a wrapper for the pseudo-cross toolchain GCC/BINUTILS/GLIBC "Return a wrapper for the pseudo-cross toolchain GCC/BINUTILS/GLIBC
@ -613,7 +614,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
;; A statically-linked Bash to be used by GLIBC-FINAL in system(3) & co. ;; A statically-linked Bash to be used by GLIBC-FINAL in system(3) & co.
(let* ((gcc (cross-gcc-wrapper gcc-boot0 binutils-boot0 (let* ((gcc (cross-gcc-wrapper gcc-boot0 binutils-boot0
glibc-final-with-bootstrap-bash glibc-final-with-bootstrap-bash
(car (assoc-ref %boot1-inputs "bash")))) (car (assoc-ref (%boot1-inputs) "bash"))))
(bash (package (bash (package
(inherit static-bash) (inherit static-bash)
(arguments (arguments
@ -632,7 +633,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
(inputs `(("gcc" ,gcc) (inputs `(("gcc" ,gcc)
("libc" ,glibc-final-with-bootstrap-bash) ("libc" ,glibc-final-with-bootstrap-bash)
("libc:static" ,glibc-final-with-bootstrap-bash "static") ("libc:static" ,glibc-final-with-bootstrap-bash "static")
,@(fold alist-delete %boot1-inputs ,@(fold alist-delete (%boot1-inputs)
'("gcc" "libc"))))) '("gcc" "libc")))))
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs bash inputs (package-with-explicit-inputs bash inputs
@ -670,7 +671,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
(delete 'patch-tests)))))))) (delete 'patch-tests))))))))
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs gettext-minimal (package-with-explicit-inputs gettext-minimal
%boot1-inputs (%boot1-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile)))) #:guile %bootstrap-guile))))
@ -707,14 +708,14 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
;; Make the cross-tools GCC-BOOT0 and BINUTILS-BOOT0 available under the ;; Make the cross-tools GCC-BOOT0 and BINUTILS-BOOT0 available under the
;; non-cross names. ;; non-cross names.
(cross-gcc-wrapper gcc-boot0 binutils-boot0 glibc-final (cross-gcc-wrapper gcc-boot0 binutils-boot0 glibc-final
(car (assoc-ref %boot1-inputs "bash")))) (car (assoc-ref (%boot1-inputs) "bash"))))
(define %boot2-inputs (define (%boot2-inputs)
;; 3rd stage inputs. ;; 3rd stage inputs.
`(("libc" ,glibc-final) `(("libc" ,glibc-final)
("libc:static" ,glibc-final "static") ("libc:static" ,glibc-final "static")
("gcc" ,gcc-boot0-wrapped) ("gcc" ,gcc-boot0-wrapped)
,@(fold alist-delete %boot1-inputs '("libc" "gcc")))) ,@(fold alist-delete (%boot1-inputs) '("libc" "gcc"))))
(define binutils-final (define binutils-final
(package-with-bootstrap-guile (package-with-bootstrap-guile
@ -724,7 +725,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
#:implicit-inputs? #f #:implicit-inputs? #f
#:allowed-references ("out" ,glibc-final) #:allowed-references ("out" ,glibc-final)
,@(package-arguments binutils))) ,@(package-arguments binutils)))
(inputs %boot2-inputs)))) (inputs (%boot2-inputs)))))
(define libstdc++ (define libstdc++
;; Intermediate libstdc++ that will allow us to build the final GCC ;; Intermediate libstdc++ that will allow us to build the final GCC
@ -750,7 +751,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
(assoc-ref %outputs "out") (assoc-ref %outputs "out")
"/include")))) "/include"))))
(outputs '("out")) (outputs '("out"))
(inputs %boot2-inputs) (inputs (%boot2-inputs))
(synopsis "GNU C++ standard library (intermediate)")))) (synopsis "GNU C++ standard library (intermediate)"))))
(define zlib-final (define zlib-final
@ -763,14 +764,14 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
#:implicit-inputs? #f #:implicit-inputs? #f
#:allowed-references ("out" ,glibc-final) #:allowed-references ("out" ,glibc-final)
,@(package-arguments zlib))) ,@(package-arguments zlib)))
(inputs %boot2-inputs)))) (inputs (%boot2-inputs)))))
(define ld-wrapper-boot3 (define ld-wrapper-boot3
;; A linker wrapper that uses the bootstrap Guile. ;; A linker wrapper that uses the bootstrap Guile.
(make-ld-wrapper "ld-wrapper-boot3" (make-ld-wrapper "ld-wrapper-boot3"
#:binutils binutils-final #:binutils binutils-final
#:guile %bootstrap-guile #:guile %bootstrap-guile
#:bash (car (assoc-ref %boot2-inputs "bash")))) #:bash (car (assoc-ref (%boot2-inputs) "bash"))))
(define gcc-final (define gcc-final
;; The final GCC. ;; The final GCC.
@ -835,13 +836,13 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
("binutils" ,binutils-final) ("binutils" ,binutils-final)
("libstdc++" ,libstdc++) ("libstdc++" ,libstdc++)
("zlib" ,zlib-final) ("zlib" ,zlib-final)
,@%boot2-inputs)))) ,@(%boot2-inputs)))))
(define %boot3-inputs (define (%boot3-inputs)
;; 4th stage inputs. ;; 4th stage inputs.
`(("gcc" ,gcc-final) `(("gcc" ,gcc-final)
("ld-wrapper" ,ld-wrapper-boot3) ("ld-wrapper" ,ld-wrapper-boot3)
,@(alist-delete "gcc" %boot2-inputs))) ,@(alist-delete "gcc" (%boot2-inputs))))
(define bash-final (define bash-final
;; Link with `-static-libgcc' to make sure we don't retain a reference ;; Link with `-static-libgcc' to make sure we don't retain a reference
@ -851,25 +852,25 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
(inherit bash-minimal) (inherit bash-minimal)
(arguments (arguments
`(#:disallowed-references `(#:disallowed-references
,(assoc-ref %boot3-inputs "coreutils&co") ,(assoc-ref (%boot3-inputs) "coreutils&co")
,@(package-arguments bash-minimal)))))) ,@(package-arguments bash-minimal))))))
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs (static-libgcc-package bash) (package-with-explicit-inputs (static-libgcc-package bash)
%boot3-inputs (%boot3-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile)))) #:guile %bootstrap-guile))))
(define %boot4-inputs (define (%boot4-inputs)
;; Now use the final Bash. ;; Now use the final Bash.
`(("bash" ,bash-final) `(("bash" ,bash-final)
,@(alist-delete "bash" %boot3-inputs))) ,@(alist-delete "bash" (%boot3-inputs))))
(define-public guile-final (define-public guile-final
;; This package must be public because other modules refer to it. However, ;; This package must be public because other modules refer to it. However,
;; mark it as hidden so that 'fold-packages' ignores it. ;; mark it as hidden so that 'fold-packages' ignores it.
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs (hidden-package guile-2.2/fixed) (package-with-explicit-inputs (hidden-package guile-2.2/fixed)
%boot4-inputs (%boot4-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile))) #:guile %bootstrap-guile)))
@ -883,7 +884,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
(inherit glibc-utf8-locales) (inherit glibc-utf8-locales)
(inputs `(("glibc" ,glibc-final) (inputs `(("glibc" ,glibc-final)
("gzip" ("gzip"
,(package-with-explicit-inputs gzip %boot4-inputs ,(package-with-explicit-inputs gzip (%boot4-inputs)
(current-source-location) (current-source-location)
#:guile %bootstrap-guile)))))) #:guile %bootstrap-guile))))))
@ -894,19 +895,19 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
#:guile guile-final #:guile guile-final
#:bash bash-final)) #:bash bash-final))
(define %boot5-inputs (define (%boot5-inputs)
;; Now with UTF-8 locales. Remember that the bootstrap binaries were built ;; Now with UTF-8 locales. Remember that the bootstrap binaries were built
;; with an older libc, which cannot load the new locale format. See ;; with an older libc, which cannot load the new locale format. See
;; <https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00737.html>. ;; <https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00737.html>.
`(("locales" ,glibc-utf8-locales-final) `(("locales" ,glibc-utf8-locales-final)
,@%boot4-inputs)) ,@(%boot4-inputs)))
(define gnu-make-final (define gnu-make-final
;; The final GNU Make, which uses the final Guile. ;; The final GNU Make, which uses the final Guile.
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs gnu-make (package-with-explicit-inputs gnu-make
`(("guile" ,guile-final) `(("guile" ,guile-final)
,@%boot5-inputs) ,@(%boot5-inputs))
(current-source-location)))) (current-source-location))))
(define coreutils-final (define coreutils-final
@ -914,7 +915,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
;; Findutils, keep a reference to the Coreutils they were built with. ;; Findutils, keep a reference to the Coreutils they were built with.
(package-with-bootstrap-guile (package-with-bootstrap-guile
(package-with-explicit-inputs coreutils (package-with-explicit-inputs coreutils
%boot5-inputs (%boot5-inputs)
(current-source-location) (current-source-location)
;; Use the final Guile, linked against the ;; Use the final Guile, linked against the
@ -927,23 +928,23 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
;; The final grep. Gzip holds a reference to it (via zgrep), so it must be ;; The final grep. Gzip holds a reference to it (via zgrep), so it must be
;; built before gzip. ;; built before gzip.
(let ((grep (package-with-bootstrap-guile (let ((grep (package-with-bootstrap-guile
(package-with-explicit-inputs grep %boot5-inputs (package-with-explicit-inputs grep (%boot5-inputs)
(current-source-location) (current-source-location)
#:guile guile-final)))) #:guile guile-final))))
(package/inherit grep (package/inherit grep
(inputs (alist-delete "pcre" (package-inputs grep))) (inputs (alist-delete "pcre" (package-inputs grep)))
(native-inputs `(("perl" ,perl-boot0)))))) (native-inputs `(("perl" ,perl-boot0))))))
(define %boot6-inputs (define (%boot6-inputs)
;; Now use the final Coreutils. ;; Now use the final Coreutils.
`(("coreutils" ,coreutils-final) `(("coreutils" ,coreutils-final)
("grep" ,grep-final) ("grep" ,grep-final)
,@%boot5-inputs)) ,@(%boot5-inputs)))
(define sed-final (define sed-final
;; The final sed. ;; The final sed.
(let ((sed (package-with-bootstrap-guile (let ((sed (package-with-bootstrap-guile
(package-with-explicit-inputs sed %boot6-inputs (package-with-explicit-inputs sed (%boot6-inputs)
(current-source-location) (current-source-location)
#:guile guile-final)))) #:guile guile-final))))
(package/inherit sed (native-inputs `(("perl" ,perl-boot0)))))) (package/inherit sed (native-inputs `(("perl" ,perl-boot0))))))
@ -954,7 +955,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
;; used for origins that have patches, thereby avoiding circular ;; used for origins that have patches, thereby avoiding circular
;; dependencies. ;; dependencies.
(let ((finalize (compose package-with-bootstrap-guile (let ((finalize (compose package-with-bootstrap-guile
(cut package-with-explicit-inputs <> %boot6-inputs (cut package-with-explicit-inputs <> (%boot6-inputs)
(current-source-location))))) (current-source-location)))))
`(,@(map (match-lambda `(,@(map (match-lambda
((name package) ((name package)

View File

@ -388,9 +388,9 @@ the image."
"Return the C compiler that uses the bootstrap toolchain. This is used only "Return the C compiler that uses the bootstrap toolchain. This is used only
by '--bootstrap', for testing purposes." by '--bootstrap', for testing purposes."
(define bootstrap-toolchain (define bootstrap-toolchain
(list (first (assoc-ref %bootstrap-inputs "gcc")) (list (first (assoc-ref (%bootstrap-inputs) "gcc"))
(first (assoc-ref %bootstrap-inputs "binutils")) (first (assoc-ref (%bootstrap-inputs) "binutils"))
(first (assoc-ref %bootstrap-inputs "libc")))) (first (assoc-ref (%bootstrap-inputs) "libc"))))
(c-compiler bootstrap-toolchain (c-compiler bootstrap-toolchain
#:guile %bootstrap-guile)) #:guile %bootstrap-guile))

View File

@ -28,7 +28,8 @@
#:use-module (gcrypt hash) #:use-module (gcrypt hash)
#:use-module (guix tests) #:use-module (guix tests)
#:use-module ((guix packages) #:use-module ((guix packages)
#:select (package-derivation package-native-search-paths)) #:select (package?
package-derivation package-native-search-paths))
#:use-module (gnu packages bootstrap) #:use-module (gnu packages bootstrap)
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
@ -39,7 +40,7 @@
(define %store (define %store
(open-connection-for-tests)) (open-connection-for-tests))
(define %bootstrap-inputs (define (%bootstrap-inputs)
;; Use the bootstrap inputs so it doesn't take ages to run these tests. ;; Use the bootstrap inputs so it doesn't take ages to run these tests.
;; This still involves building Make, Diffutils, and Findutils. ;; This still involves building Make, Diffutils, and Findutils.
;; XXX: We're relying on the higher-level `package-derivations' here. ;; XXX: We're relying on the higher-level `package-derivations' here.
@ -47,14 +48,18 @@
(map (match-lambda (map (match-lambda
((name package) ((name package)
(list name (package-derivation %store package)))) (list name (package-derivation %store package))))
(@@ (gnu packages commencement) %boot0-inputs)))) (filter
(compose package? cadr)
((@@ (gnu packages commencement) %boot0-inputs))))))
(define %bootstrap-search-paths (define (%bootstrap-search-paths)
;; Search path specifications that go with %BOOTSTRAP-INPUTS. ;; Search path specifications that go with %BOOTSTRAP-INPUTS.
(append-map (match-lambda (append-map (match-lambda
((name package _ ...) ((name package _ ...)
(package-native-search-paths package))) (package-native-search-paths package)))
(@@ (gnu packages commencement) %boot0-inputs))) (filter
(compose package? cadr)
((@@ (gnu packages commencement) %boot0-inputs)))))
(define url-fetch* (define url-fetch*
(store-lower url-fetch)) (store-lower url-fetch))
@ -104,9 +109,9 @@
#:guile %bootstrap-guile)) #:guile %bootstrap-guile))
(build (gnu-build %store "hello-2.8" (build (gnu-build %store "hello-2.8"
`(("source" ,tarball) `(("source" ,tarball)
,@%bootstrap-inputs) ,@(%bootstrap-inputs))
#:guile %bootstrap-guile #:guile %bootstrap-guile
#:search-paths %bootstrap-search-paths)) #:search-paths (%bootstrap-search-paths)))
(out (derivation->output-path build))) (out (derivation->output-path build)))
(and (build-derivations %store (list (pk 'hello-drv build))) (and (build-derivations %store (list (pk 'hello-drv build)))
(valid-path? %store out) (valid-path? %store out)

View File

@ -153,9 +153,9 @@ edges."
(match nodes (match nodes
(((labels names) ...) (((labels names) ...)
names)))) names))))
(match %bootstrap-inputs (match (%bootstrap-inputs)
(((labels packages) ...) (((labels packages) ...)
(map package-full-name packages)))))))) (map package-full-name (filter package? packages)))))))))
(test-assert "bag DAG, including origins" (test-assert "bag DAG, including origins"
(let-values (((backend nodes+edges) (make-recording-backend))) (let-values (((backend nodes+edges) (make-recording-backend)))

View File

@ -94,8 +94,9 @@
`(,name ,(package-derivation %store package)))) `(,name ,(package-derivation %store package))))
;; Purposefully leave duplicate entries. ;; Purposefully leave duplicate entries.
(append %bootstrap-inputs (filter (compose package? cadr)
(take %bootstrap-inputs 3)))) (append (%bootstrap-inputs)
(take (%bootstrap-inputs) 3)))))
(builder `(begin (builder `(begin
(use-modules (guix build union)) (use-modules (guix build union))
(union-build (assoc-ref %outputs "out") (union-build (assoc-ref %outputs "out")