diff options
| author | Christopher Baines <mail@cbaines.net> | 2024-07-30 11:09:20 +0100 |
|---|---|---|
| committer | Christopher Baines <mail@cbaines.net> | 2024-08-01 10:32:31 +0100 |
| commit | f4aec15f47eeb23bc34ce30e59147bbb206980df (patch) | |
| tree | a3ecedb76714bfd29f93e36ca88d183d46e138f8 /tests/gexp.scm | |
| parent | 450cd7e15fdb65e52bccb919e99cb98d7615bc45 (diff) | |
tests: gexp: Handle incorrect guile-bootstrap version for riscv.
The tests currently fail when run on riscv-linux (affecting the guix package)
because Guile 3 is used as the bootstrap guile. Correcting the package
version seems hard, so I'm just tweaking the tests to use the right effective
version for riscv64-linux.
* tests/gexp.scm (bootstrap-guile-effective-version): New procedure.
("gexp->derivation & with-extensions", "lower-gexp", "lower-gexp,
raw-derivation-file"): Use bootstrap-guile-effective-version.
Change-Id: I3995e1f6b58ada1baf38a8ec55b0173059dd0079
Diffstat (limited to 'tests/gexp.scm')
| -rw-r--r-- | tests/gexp.scm | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index 905009caeee..b35bfc920f2 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm | |||
| @@ -47,6 +47,13 @@ | |||
| 47 | (define %store | 47 | (define %store |
| 48 | (open-connection-for-tests)) | 48 | (open-connection-for-tests)) |
| 49 | 49 | ||
| 50 | (define (bootstrap-guile-effective-version) | ||
| 51 | ;; TODO The package version of %bootstrap-guile is incorrect for | ||
| 52 | ;; riscv64-linux | ||
| 53 | (if (string=? "riscv64-linux" (%current-system)) | ||
| 54 | "3.0" | ||
| 55 | (package-version %bootstrap-guile))) | ||
| 56 | |||
| 50 | ;; Globally disable grafts because they can trigger early builds. | 57 | ;; Globally disable grafts because they can trigger early builds. |
| 51 | (%graft? #f) | 58 | (%graft? #f) |
| 52 | 59 | ||
| @@ -1099,8 +1106,8 @@ importing.* \\(guix config\\) from the host" | |||
| 1099 | (write (list the-answer (multiply 2)) | 1106 | (write (list the-answer (multiply 2)) |
| 1100 | port))))))) | 1107 | port))))))) |
| 1101 | (drv (gexp->derivation "thingie" build | 1108 | (drv (gexp->derivation "thingie" build |
| 1102 | ;; %BOOTSTRAP-GUILE is 2.0. | 1109 | #:effective-version |
| 1103 | #:effective-version "2.0")) | 1110 | (bootstrap-guile-effective-version))) |
| 1104 | (out -> (derivation->output-path drv))) | 1111 | (out -> (derivation->output-path drv))) |
| 1105 | (mbegin %store-monad | 1112 | (mbegin %store-monad |
| 1106 | (built-derivations (list drv)) | 1113 | (built-derivations (list drv)) |
| @@ -1120,7 +1127,8 @@ importing.* \\(guix config\\) from the host" | |||
| 1120 | mkdir-p | 1127 | mkdir-p |
| 1121 | the-answer)))) | 1128 | the-answer)))) |
| 1122 | (lexp (lower-gexp exp | 1129 | (lexp (lower-gexp exp |
| 1123 | #:effective-version "2.0"))) | 1130 | #:effective-version |
| 1131 | (bootstrap-guile-effective-version)))) | ||
| 1124 | (define (matching-input drv output) | 1132 | (define (matching-input drv output) |
| 1125 | (lambda (input) | 1133 | (lambda (input) |
| 1126 | (and (eq? (derivation-input-derivation input) drv) | 1134 | (and (eq? (derivation-input-derivation input) drv) |
| @@ -1134,12 +1142,15 @@ importing.* \\(guix config\\) from the host" | |||
| 1134 | (lowered-gexp-inputs lexp)) | 1142 | (lowered-gexp-inputs lexp)) |
| 1135 | (member (string-append | 1143 | (member (string-append |
| 1136 | (derivation->output-path extension-drv) | 1144 | (derivation->output-path extension-drv) |
| 1137 | "/share/guile/site/2.0") | 1145 | "/share/guile/site/" |
| 1146 | (bootstrap-guile-effective-version)) | ||
| 1138 | (lowered-gexp-load-path lexp)) | 1147 | (lowered-gexp-load-path lexp)) |
| 1139 | (= 2 (length (lowered-gexp-load-path lexp))) | 1148 | (= 2 (length (lowered-gexp-load-path lexp))) |
| 1140 | (member (string-append | 1149 | (member (string-append |
| 1141 | (derivation->output-path extension-drv) | 1150 | (derivation->output-path extension-drv) |
| 1142 | "/lib/guile/2.0/site-ccache") | 1151 | "/lib/guile/" |
| 1152 | (bootstrap-guile-effective-version) | ||
| 1153 | "/site-ccache") | ||
| 1143 | (lowered-gexp-load-compiled-path lexp)) | 1154 | (lowered-gexp-load-compiled-path lexp)) |
| 1144 | (= 2 (length (lowered-gexp-load-compiled-path lexp))) | 1155 | (= 2 (length (lowered-gexp-load-compiled-path lexp))) |
| 1145 | (eq? (derivation-input-derivation (lowered-gexp-guile lexp)) | 1156 | (eq? (derivation-input-derivation (lowered-gexp-guile lexp)) |
| @@ -1149,7 +1160,10 @@ importing.* \\(guix config\\) from the host" | |||
| 1149 | (mlet* %store-monad ((thing -> (program-file "prog" #~(display "hi!"))) | 1160 | (mlet* %store-monad ((thing -> (program-file "prog" #~(display "hi!"))) |
| 1150 | (exp -> #~(list #$(raw-derivation-file thing))) | 1161 | (exp -> #~(list #$(raw-derivation-file thing))) |
| 1151 | (drv (lower-object thing)) | 1162 | (drv (lower-object thing)) |
| 1152 | (lexp (lower-gexp exp #:effective-version "2.0"))) | 1163 | (lexp (lower-gexp |
| 1164 | exp | ||
| 1165 | #:effective-version | ||
| 1166 | (bootstrap-guile-effective-version)))) | ||
| 1153 | (return (and (equal? `(list ,(derivation-file-name drv)) | 1167 | (return (and (equal? `(list ,(derivation-file-name drv)) |
| 1154 | (lowered-gexp-sexp lexp)) | 1168 | (lowered-gexp-sexp lexp)) |
| 1155 | (equal? (list (derivation-file-name drv)) | 1169 | (equal? (list (derivation-file-name drv)) |
