diff options
| -rw-r--r-- | gnu/packages/bootstrap.scm | 14 | ||||
| -rw-r--r-- | guix/tests.scm | 33 | ||||
| -rw-r--r-- | tests/guix-environment.sh | 27 | ||||
| -rw-r--r-- | tests/guix-package-net.sh | 2 | ||||
| -rw-r--r-- | tests/packages.scm | 6 | ||||
| -rw-r--r-- | tests/profiles.scm | 7 | ||||
| -rw-r--r-- | tests/union.scm | 9 |
7 files changed, 61 insertions, 37 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 255141ae87a..c78aaa33d05 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm | |||
| @@ -53,7 +53,9 @@ | |||
| 53 | %bootstrap-glibc | 53 | %bootstrap-glibc |
| 54 | %bootstrap-inputs | 54 | %bootstrap-inputs |
| 55 | %bootstrap-mescc-tools | 55 | %bootstrap-mescc-tools |
| 56 | %bootstrap-mes)) | 56 | %bootstrap-mes |
| 57 | |||
| 58 | %bootstrap-inputs-for-tests)) | ||
| 57 | 59 | ||
| 58 | ;;; Commentary: | 60 | ;;; Commentary: |
| 59 | ;;; | 61 | ;;; |
| @@ -809,4 +811,14 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \ | |||
| 809 | ;; In gnu-build-system.scm, we rely on the availability of Bash. | 811 | ;; In gnu-build-system.scm, we rely on the availability of Bash. |
| 810 | ("bash" ,%bootstrap-coreutils&co))) | 812 | ("bash" ,%bootstrap-coreutils&co))) |
| 811 | 813 | ||
| 814 | (define %bootstrap-inputs-for-tests | ||
| 815 | ;; These are bootstrap inputs that are cheap to produce (no compilation | ||
| 816 | ;; needed) and that are meant to be used for testing. (These are those we | ||
| 817 | ;; used before the Mes-based reduced bootstrap.) | ||
| 818 | `(("libc" ,%bootstrap-glibc) | ||
| 819 | ("gcc" ,%bootstrap-gcc) | ||
| 820 | ("binutils" ,%bootstrap-binutils) | ||
| 821 | ("coreutils&co" ,%bootstrap-coreutils&co) | ||
| 822 | ("bash" ,%bootstrap-coreutils&co))) | ||
| 823 | |||
| 812 | ;;; bootstrap.scm ends here | 824 | ;;; bootstrap.scm ends here |
diff --git a/guix/tests.scm b/guix/tests.scm index 66d60e964e0..9df6353798c 100644 --- a/guix/tests.scm +++ b/guix/tests.scm | |||
| @@ -23,8 +23,10 @@ | |||
| 23 | #:use-module (guix packages) | 23 | #:use-module (guix packages) |
| 24 | #:use-module (guix base32) | 24 | #:use-module (guix base32) |
| 25 | #:use-module (guix serialization) | 25 | #:use-module (guix serialization) |
| 26 | #:use-module ((guix utils) #:select (substitute-keyword-arguments)) | ||
| 26 | #:use-module (gcrypt hash) | 27 | #:use-module (gcrypt hash) |
| 27 | #:use-module (guix build-system gnu) | 28 | #:use-module (guix build-system gnu) |
| 29 | #:use-module (gnu packages base) | ||
| 28 | #:use-module (gnu packages bootstrap) | 30 | #:use-module (gnu packages bootstrap) |
| 29 | #:use-module (srfi srfi-34) | 31 | #:use-module (srfi srfi-34) |
| 30 | #:use-module (srfi srfi-64) | 32 | #:use-module (srfi srfi-64) |
| @@ -50,7 +52,9 @@ | |||
| 50 | with-derivation-narinfo | 52 | with-derivation-narinfo |
| 51 | with-derivation-substitute | 53 | with-derivation-substitute |
| 52 | dummy-package | 54 | dummy-package |
| 53 | dummy-origin)) | 55 | dummy-origin |
| 56 | |||
| 57 | gnu-make-for-tests)) | ||
| 54 | 58 | ||
| 55 | ;;; Commentary: | 59 | ;;; Commentary: |
| 56 | ;;; | 60 | ;;; |
| @@ -364,6 +368,33 @@ default values, and with EXTRA-FIELDS set as specified." | |||
| 364 | (sha256 (base32 (make-string 52 #\x)))))) | 368 | (sha256 (base32 (make-string 52 #\x)))))) |
| 365 | (origin (inherit o) extra-fields ...))) | 369 | (origin (inherit o) extra-fields ...))) |
| 366 | 370 | ||
| 371 | (define gnu-make-for-tests | ||
| 372 | ;; This is a variant of 'gnu-make-boot0' that can be built with minimal | ||
| 373 | ;; resources. | ||
| 374 | (package-with-bootstrap-guile | ||
| 375 | (package | ||
| 376 | (inherit gnu-make) | ||
| 377 | (name "make-test-boot0") | ||
| 378 | (arguments | ||
| 379 | `(#:guile ,%bootstrap-guile | ||
| 380 | #:implicit-inputs? #f | ||
| 381 | #:tests? #f ;cannot run "make check" | ||
| 382 | ,@(substitute-keyword-arguments (package-arguments gnu-make) | ||
| 383 | ((#:phases phases) | ||
| 384 | `(modify-phases ,phases | ||
| 385 | (replace 'build | ||
| 386 | (lambda _ | ||
| 387 | (invoke "./build.sh") | ||
| 388 | #t)) | ||
| 389 | (replace 'install | ||
| 390 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 391 | (let* ((out (assoc-ref outputs "out")) | ||
| 392 | (bin (string-append out "/bin"))) | ||
| 393 | (install-file "make" bin) | ||
| 394 | #t)))))))) | ||
| 395 | (native-inputs '()) ;no need for 'pkg-config' | ||
| 396 | (inputs %bootstrap-inputs-for-tests)))) | ||
| 397 | |||
| 367 | ;; Local Variables: | 398 | ;; Local Variables: |
| 368 | ;; eval: (put 'call-with-derivation-narinfo 'scheme-indent-function 1) | 399 | ;; eval: (put 'call-with-derivation-narinfo 'scheme-indent-function 1) |
| 369 | ;; eval: (put 'call-with-derivation-substitute 'scheme-indent-function 2) | 400 | ;; eval: (put 'call-with-derivation-substitute 'scheme-indent-function 2) |
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh index a670db36be8..fb1c1a022d7 100644 --- a/tests/guix-environment.sh +++ b/tests/guix-environment.sh | |||
| @@ -156,7 +156,7 @@ if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null | |||
| 156 | then | 156 | then |
| 157 | # Compute the build environment for the initial GNU Make. | 157 | # Compute the build environment for the initial GNU Make. |
| 158 | guix environment --bootstrap --no-substitutes --search-paths --pure \ | 158 | guix environment --bootstrap --no-substitutes --search-paths --pure \ |
| 159 | -e '(@@ (gnu packages commencement) gnu-make-boot0)' > "$tmpdir/a" | 159 | -e '(@ (guix tests) gnu-make-for-tests)' > "$tmpdir/a" |
| 160 | 160 | ||
| 161 | # Make sure bootstrap binaries are in the profile. | 161 | # Make sure bootstrap binaries are in the profile. |
| 162 | profile=`grep "^export PATH" "$tmpdir/a" | sed -r 's|^.*="(.*)/bin"|\1|'` | 162 | profile=`grep "^export PATH" "$tmpdir/a" | sed -r 's|^.*="(.*)/bin"|\1|'` |
| @@ -177,30 +177,15 @@ then | |||
| 177 | # Make sure that the shell spawned with '--exec' sees the same environment | 177 | # Make sure that the shell spawned with '--exec' sees the same environment |
| 178 | # as returned by '--search-paths'. | 178 | # as returned by '--search-paths'. |
| 179 | guix environment --bootstrap --no-substitutes --pure \ | 179 | guix environment --bootstrap --no-substitutes --pure \ |
| 180 | -e '(@@ (gnu packages commencement) gnu-make-boot0)' \ | 180 | -e '(@ (guix tests) gnu-make-for-tests)' \ |
| 181 | -- /bin/sh -c 'echo $PATH $CPATH $LIBRARY_PATH' > "$tmpdir/b" | 181 | -- /bin/sh -c 'echo $PATH $CPATH $LIBRARY_PATH' > "$tmpdir/b" |
| 182 | ( . "$tmpdir/a" ; echo $PATH $CPATH $LIBRARY_PATH ) > "$tmpdir/c" | 182 | ( . "$tmpdir/a" ; echo $PATH $CPATH $LIBRARY_PATH ) > "$tmpdir/c" |
| 183 | cmp "$tmpdir/b" "$tmpdir/c" | 183 | cmp "$tmpdir/b" "$tmpdir/c" |
| 184 | 184 | ||
| 185 | rm "$tmpdir"/* | 185 | rm "$tmpdir"/* |
| 186 | 186 | ||
| 187 | # Compute the build environment for the initial GNU Findutils. | ||
| 188 | guix environment --bootstrap --no-substitutes --search-paths --pure \ | ||
| 189 | -e '(@@ (gnu packages commencement) findutils-boot0)' > "$tmpdir/a" | ||
| 190 | profile=`grep "^export PATH" "$tmpdir/a" | sed -r 's|^.*="(.*)/bin"|\1|'` | ||
| 191 | |||
| 192 | # Make sure the bootstrap binaries are all listed where they belong. | ||
| 193 | grep -E "^export PATH=\"$profile/bin\"" "$tmpdir/a" | ||
| 194 | grep -E "^export CPATH=\"$profile/include\"" "$tmpdir/a" | ||
| 195 | grep -E "^export LIBRARY_PATH=\"$profile/lib\"" "$tmpdir/a" | ||
| 196 | for dep in bootstrap-binaries-0 gcc-bootstrap-0 glibc-bootstrap-0 \ | ||
| 197 | make-boot0 | ||
| 198 | do | ||
| 199 | guix gc --references "$profile" | grep "$dep" | ||
| 200 | done | ||
| 201 | |||
| 202 | # The following test assumes 'make-boot0' has a "debug" output. | 187 | # The following test assumes 'make-boot0' has a "debug" output. |
| 203 | make_boot0_debug="`guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)' | grep -e -debug`" | 188 | make_boot0_debug="`guix build -e '(@ (guix tests) gnu-make-for-tests)' | grep -e -debug`" |
| 204 | test "x$make_boot0_debug" != "x" | 189 | test "x$make_boot0_debug" != "x" |
| 205 | 190 | ||
| 206 | # Make sure the "debug" output is not listed. | 191 | # Make sure the "debug" output is not listed. |
| @@ -210,7 +195,7 @@ then | |||
| 210 | # Compute the build environment for the initial GNU Make, but add in the | 195 | # Compute the build environment for the initial GNU Make, but add in the |
| 211 | # bootstrap Guile as an ad-hoc addition. | 196 | # bootstrap Guile as an ad-hoc addition. |
| 212 | guix environment --bootstrap --no-substitutes --search-paths --pure \ | 197 | guix environment --bootstrap --no-substitutes --search-paths --pure \ |
| 213 | -e '(@@ (gnu packages commencement) gnu-make-boot0)' \ | 198 | -e '(@ (guix tests) gnu-make-for-tests)' \ |
| 214 | --ad-hoc guile-bootstrap > "$tmpdir/a" | 199 | --ad-hoc guile-bootstrap > "$tmpdir/a" |
| 215 | profile=`grep "^export PATH" "$tmpdir/a" | sed -r 's|^.*="(.*)/bin"|\1|'` | 200 | profile=`grep "^export PATH" "$tmpdir/a" | sed -r 's|^.*="(.*)/bin"|\1|'` |
| 216 | 201 | ||
| @@ -227,14 +212,14 @@ then | |||
| 227 | # Make sure a package list with plain package objects and package+output | 212 | # Make sure a package list with plain package objects and package+output |
| 228 | # tuples can be used with -e. | 213 | # tuples can be used with -e. |
| 229 | expr_list_test_code=" | 214 | expr_list_test_code=" |
| 230 | (list (@@ (gnu packages commencement) gnu-make-boot0) | 215 | (list (@ (guix tests) gnu-make-for-tests) |
| 231 | (list (@ (gnu packages bootstrap) %bootstrap-guile) \"out\"))" | 216 | (list (@ (gnu packages bootstrap) %bootstrap-guile) \"out\"))" |
| 232 | 217 | ||
| 233 | guix environment --bootstrap --ad-hoc --no-substitutes --search-paths \ | 218 | guix environment --bootstrap --ad-hoc --no-substitutes --search-paths \ |
| 234 | --pure -e "$expr_list_test_code" > "$tmpdir/a" | 219 | --pure -e "$expr_list_test_code" > "$tmpdir/a" |
| 235 | profile=`grep "^export PATH" "$tmpdir/a" | sed -r 's|^.*="(.*)/bin"|\1|'` | 220 | profile=`grep "^export PATH" "$tmpdir/a" | sed -r 's|^.*="(.*)/bin"|\1|'` |
| 236 | 221 | ||
| 237 | for dep in make-boot0 guile-bootstrap | 222 | for dep in make-test-boot0 guile-bootstrap |
| 238 | do | 223 | do |
| 239 | guix gc --references "$profile" | grep "$dep" | 224 | guix gc --references "$profile" | grep "$dep" |
| 240 | done | 225 | done |
diff --git a/tests/guix-package-net.sh b/tests/guix-package-net.sh index 82c346dd4c3..48a94865e11 100644 --- a/tests/guix-package-net.sh +++ b/tests/guix-package-net.sh | |||
| @@ -57,7 +57,7 @@ test -L "$profile" && test -L "$profile-1-link" | |||
| 57 | ! test -f "$profile-2-link" | 57 | ! test -f "$profile-2-link" |
| 58 | test -f "$profile/bin/guile" | 58 | test -f "$profile/bin/guile" |
| 59 | 59 | ||
| 60 | boot_make="(@@ (gnu packages commencement) gnu-make-boot0)" | 60 | boot_make="(@ (guix tests) gnu-make-for-tests)" |
| 61 | boot_make_drv="`guix build -e "$boot_make" | grep -v -e -debug`" | 61 | boot_make_drv="`guix build -e "$boot_make" | grep -v -e -debug`" |
| 62 | guix package --bootstrap -p "$profile" -i "$boot_make_drv" | 62 | guix package --bootstrap -p "$profile" -i "$boot_make_drv" |
| 63 | test -L "$profile-2-link" | 63 | test -L "$profile-2-link" |
diff --git a/tests/packages.scm b/tests/packages.scm index af1f76e36d8..bd100bea5be 100644 --- a/tests/packages.scm +++ b/tests/packages.scm | |||
| @@ -935,9 +935,9 @@ | |||
| 935 | (when (or (not (network-reachable?)) (shebang-too-long?)) | 935 | (when (or (not (network-reachable?)) (shebang-too-long?)) |
| 936 | (test-skip 1)) | 936 | (test-skip 1)) |
| 937 | (test-assert "GNU Make, bootstrap" | 937 | (test-assert "GNU Make, bootstrap" |
| 938 | ;; GNU Make is the first program built during bootstrap; we choose it | 938 | ;; GNU-MAKE-FOR-TESTS can be built cheaply; we choose it here so that the |
| 939 | ;; here so that the test doesn't last for too long. | 939 | ;; test doesn't last for too long. |
| 940 | (let ((gnu-make (@@ (gnu packages commencement) gnu-make-boot0))) | 940 | (let ((gnu-make gnu-make-for-tests)) |
| 941 | (and (package? gnu-make) | 941 | (and (package? gnu-make) |
| 942 | (or (location? (package-location gnu-make)) | 942 | (or (location? (package-location gnu-make)) |
| 943 | (not (package-location gnu-make))) | 943 | (not (package-location gnu-make))) |
diff --git a/tests/profiles.scm b/tests/profiles.scm index eef93e24cfc..a4e28672b54 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm | |||
| @@ -239,11 +239,10 @@ | |||
| 239 | (unless (network-reachable?) (test-skip 1)) | 239 | (unless (network-reachable?) (test-skip 1)) |
| 240 | (test-assertm "profile-derivation relative symlinks, two entries" | 240 | (test-assertm "profile-derivation relative symlinks, two entries" |
| 241 | (mlet* %store-monad | 241 | (mlet* %store-monad |
| 242 | ((gnu-make-boot0 -> (@@ (gnu packages commencement) gnu-make-boot0)) | 242 | ((manifest -> (packages->manifest |
| 243 | (manifest -> (packages->manifest | 243 | (list %bootstrap-guile gnu-make-for-tests))) |
| 244 | (list %bootstrap-guile gnu-make-boot0))) | ||
| 245 | (guile (package->derivation %bootstrap-guile)) | 244 | (guile (package->derivation %bootstrap-guile)) |
| 246 | (make (package->derivation gnu-make-boot0)) | 245 | (make (package->derivation gnu-make-for-tests)) |
| 247 | (drv (profile-derivation manifest | 246 | (drv (profile-derivation manifest |
| 248 | #:relative-symlinks? #t | 247 | #:relative-symlinks? #t |
| 249 | #:hooks '() | 248 | #:hooks '() |
diff --git a/tests/union.scm b/tests/union.scm index 091895ff8eb..a8387edf42e 100644 --- a/tests/union.scm +++ b/tests/union.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> | 3 | ;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -32,9 +32,6 @@ | |||
| 32 | #:use-module (rnrs io ports) | 32 | #:use-module (rnrs io ports) |
| 33 | #:use-module (ice-9 match)) | 33 | #:use-module (ice-9 match)) |
| 34 | 34 | ||
| 35 | (define %bootstrap-inputs | ||
| 36 | (@@ (gnu packages commencement) %bootstrap-inputs+toolchain)) | ||
| 37 | |||
| 38 | ;; Exercise the (guix build union) module. | 35 | ;; Exercise the (guix build union) module. |
| 39 | 36 | ||
| 40 | (define %store | 37 | (define %store |
| @@ -99,8 +96,8 @@ | |||
| 99 | 96 | ||
| 100 | ;; Purposefully leave duplicate entries. | 97 | ;; Purposefully leave duplicate entries. |
| 101 | (filter (compose package? cadr) | 98 | (filter (compose package? cadr) |
| 102 | (append (%bootstrap-inputs) | 99 | (append %bootstrap-inputs-for-tests |
| 103 | (take (%bootstrap-inputs) 3))))) | 100 | (take %bootstrap-inputs-for-tests 3))))) |
| 104 | (builder `(begin | 101 | (builder `(begin |
| 105 | (use-modules (guix build union)) | 102 | (use-modules (guix build union)) |
| 106 | (union-build (assoc-ref %outputs "out") | 103 | (union-build (assoc-ref %outputs "out") |
