bootstrap: Move use-modules to top of builder.

* gnu/packages/bootstrap.scm (package-from-tarball): Move use-modules to top of builder.
(%bootstrap-glibc): Likewise.
(%bootstrap-gcc): Likewise.
This commit is contained in:
Jan Nieuwenhuizen 2018-10-21 23:39:43 +02:00
parent 35dcf85157
commit 668ffe1e4e
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 91 additions and 85 deletions

View File

@ -115,11 +115,13 @@ or false to signal an error."
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
#:modules ((guix build utils)) #:modules ((guix build utils))
#:builder #:builder
(begin
(use-modules (guix build utils))
(let ((out (assoc-ref %outputs "out")) (let ((out (assoc-ref %outputs "out"))
(tar (assoc-ref %build-inputs "tar")) (tar (assoc-ref %build-inputs "tar"))
(xz (assoc-ref %build-inputs "xz")) (xz (assoc-ref %build-inputs "xz"))
(tarball (assoc-ref %build-inputs "tarball"))) (tarball (assoc-ref %build-inputs "tarball")))
(use-modules (guix build utils))
(mkdir out) (mkdir out)
(copy-file tarball "binaries.tar.xz") (copy-file tarball "binaries.tar.xz")
@ -131,7 +133,7 @@ or false to signal an error."
,@(if snippet (list snippet) '()) ,@(if snippet (list snippet) '())
(or (not ,program-to-test) (or (not ,program-to-test)
(invoke (string-append "bin/" ,program-to-test) (invoke (string-append "bin/" ,program-to-test)
"--version"))))))) "--version"))))))))
(inputs (inputs
`(("tar" ,(search-bootstrap-binary "tar" (%current-system))) `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
("xz" ,(search-bootstrap-binary "xz" (%current-system))) ("xz" ,(search-bootstrap-binary "xz" (%current-system)))
@ -460,11 +462,13 @@ $out/bin/guile --version~%"
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
#:modules ((guix build utils)) #:modules ((guix build utils))
#:builder #:builder
(begin
(use-modules (guix build utils))
(let ((out (assoc-ref %outputs "out")) (let ((out (assoc-ref %outputs "out"))
(tar (assoc-ref %build-inputs "tar")) (tar (assoc-ref %build-inputs "tar"))
(xz (assoc-ref %build-inputs "xz")) (xz (assoc-ref %build-inputs "xz"))
(tarball (assoc-ref %build-inputs "tarball"))) (tarball (assoc-ref %build-inputs "tarball")))
(use-modules (guix build utils))
(mkdir out) (mkdir out)
(copy-file tarball "binaries.tar.xz") (copy-file tarball "binaries.tar.xz")
@ -481,7 +485,7 @@ $out/bin/guile --version~%"
(("/[^ ]+/lib/(libc|ld)" _ prefix) (("/[^ ]+/lib/(libc|ld)" _ prefix)
(string-append out "/lib/" prefix))) (string-append out "/lib/" prefix)))
#t))))) #t))))))
(inputs (inputs
`(("tar" ,(search-bootstrap-binary "tar" (%current-system))) `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
("xz" ,(search-bootstrap-binary "xz" (%current-system))) ("xz" ,(search-bootstrap-binary "xz" (%current-system)))
@ -531,14 +535,16 @@ $out/bin/guile --version~%"
`(#:guile ,%bootstrap-guile `(#:guile ,%bootstrap-guile
#:modules ((guix build utils)) #:modules ((guix build utils))
#:builder #:builder
(begin
(use-modules (guix build utils)
(ice-9 popen))
(let ((out (assoc-ref %outputs "out")) (let ((out (assoc-ref %outputs "out"))
(tar (assoc-ref %build-inputs "tar")) (tar (assoc-ref %build-inputs "tar"))
(xz (assoc-ref %build-inputs "xz")) (xz (assoc-ref %build-inputs "xz"))
(bash (assoc-ref %build-inputs "bash")) (bash (assoc-ref %build-inputs "bash"))
(libc (assoc-ref %build-inputs "libc")) (libc (assoc-ref %build-inputs "libc"))
(tarball (assoc-ref %build-inputs "tarball"))) (tarball (assoc-ref %build-inputs "tarball")))
(use-modules (guix build utils)
(ice-9 popen))
(mkdir out) (mkdir out)
(copy-file tarball "binaries.tar.xz") (copy-file tarball "binaries.tar.xz")
@ -563,7 +569,7 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
,(glibc-dynamic-linker)))) ,(glibc-dynamic-linker))))
(chmod "gcc" #o555) (chmod "gcc" #o555)
#t))))) #t))))))
(inputs (inputs
`(("tar" ,(search-bootstrap-binary "tar" (%current-system))) `(("tar" ,(search-bootstrap-binary "tar" (%current-system)))
("xz" ,(search-bootstrap-binary "xz" (%current-system))) ("xz" ,(search-bootstrap-binary "xz" (%current-system)))