diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2025-10-19 22:33:32 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-03-08 14:13:49 +0100 |
| commit | 01ff86a9bb2ac99232845ea70c91adbf117236d3 (patch) | |
| tree | e2905f6f2bff24aafeaef00bf0c615b374047e1a /gnu | |
| parent | 1758aca454d5a5c26a9fef29f239ef5a65f161d7 (diff) | |
gnu: guix: Drop input labels.
* gnu/packages/bootstrap.scm
(bootstrap-executable*): Add a file-name argument to the former
bootstrap-executable and rename from it.
(bootstrap-executable): New procedure, matching the API of the
previous procedure, and adding the file-name argument when absent and
needed.
* gnu/packages/package-management.scm (guix)[inputs]: Drop input labels.
[arguments]<#:phases>: In phase 'copy-bootstrap-guile, adapt input
selection and the intern procedure for this purpose.
(guix-daemon)[inputs]: Adapt input removal.
* tests/packages.scm (package-source-derivation, snippet): Adapt
bootstrap-guile-origin call.
Change-Id: I9ca2f0170c386575fccf96e05f9979219364255b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #5154
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/bootstrap.scm | 15 | ||||
| -rw-r--r-- | gnu/packages/package-management.scm | 111 |
2 files changed, 68 insertions, 58 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 0b4b29c833a..01053fb3e19 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm | |||
| @@ -46,7 +46,8 @@ | |||
| 46 | #:use-module (srfi srfi-34) | 46 | #:use-module (srfi srfi-34) |
| 47 | #:use-module (srfi srfi-35) | 47 | #:use-module (srfi srfi-35) |
| 48 | #:use-module (ice-9 match) | 48 | #:use-module (ice-9 match) |
| 49 | #:export (bootstrap-origin | 49 | #:export (bootstrap-guile-url-path |
| 50 | bootstrap-origin | ||
| 50 | package-with-bootstrap-guile | 51 | package-with-bootstrap-guile |
| 51 | glibc-dynamic-linker | 52 | glibc-dynamic-linker |
| 52 | 53 | ||
| @@ -181,8 +182,8 @@ | |||
| 181 | (_ (string-append system "/" program | 182 | (_ (string-append system "/" program |
| 182 | "?id=44f07d1dc6806e97c4e9ee3e6be883cc59dc666e")))) | 183 | "?id=44f07d1dc6806e97c4e9ee3e6be883cc59dc666e")))) |
| 183 | 184 | ||
| 184 | (define bootstrap-executable | 185 | (define bootstrap-executable* |
| 185 | (mlambda (program system) | 186 | (mlambda (program system file-name) |
| 186 | "Return an origin for PROGRAM, a statically-linked bootstrap executable | 187 | "Return an origin for PROGRAM, a statically-linked bootstrap executable |
| 187 | built for SYSTEM." | 188 | built for SYSTEM." |
| 188 | (let ((system (if (string=? system "x86_64-linux") | 189 | (let ((system (if (string=? system "x86_64-linux") |
| @@ -203,9 +204,15 @@ for system '~a'") | |||
| 203 | (uri (map (cute string-append <> | 204 | (uri (map (cute string-append <> |
| 204 | (bootstrap-executable-file-name system program)) | 205 | (bootstrap-executable-file-name system program)) |
| 205 | %bootstrap-executable-base-urls)) | 206 | %bootstrap-executable-base-urls)) |
| 206 | (file-name program) | 207 | ;; XXX: In the long term, migrate all boostrap executables to |
| 208 | ;; (string-append "bootstrap-" program), and drop the additional | ||
| 209 | ;; file-name argument. | ||
| 210 | (file-name file-name) | ||
| 207 | (hash (content-hash bv sha256)))))))) | 211 | (hash (content-hash bv sha256)))))))) |
| 208 | 212 | ||
| 213 | (define* (bootstrap-executable program system #:optional file-name) | ||
| 214 | (bootstrap-executable* program system (or file-name program))) | ||
| 215 | |||
| 209 | 216 | ||
| 210 | ;;; | 217 | ;;; |
| 211 | ;;; Helper procedures. | 218 | ;;; Helper procedures. |
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 312dc159738..a79d3a17430 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm | |||
| @@ -340,9 +340,9 @@ $(prefix)/etc/openrc\n"))) | |||
| 340 | (lambda* (#:key system target inputs #:allow-other-keys) | 340 | (lambda* (#:key system target inputs #:allow-other-keys) |
| 341 | ;; Copy the bootstrap guile tarball in the store | 341 | ;; Copy the bootstrap guile tarball in the store |
| 342 | ;; used by the test suite. | 342 | ;; used by the test suite. |
| 343 | (define (intern file recursive?) | 343 | (define* (intern file #:optional recursive? name) |
| 344 | ;; Note: don't use 'guix download' here because we | 344 | ;; Note: don't use 'guix download' here because we need to |
| 345 | ;; need to set the 'recursive?' argument. | 345 | ;; set the 'recursive?' argument to keep permissions bits. |
| 346 | (define base | 346 | (define base |
| 347 | (strip-store-file-name file)) | 347 | (strip-store-file-name file)) |
| 348 | 348 | ||
| @@ -350,7 +350,7 @@ $(prefix)/etc/openrc\n"))) | |||
| 350 | `(begin | 350 | `(begin |
| 351 | (use-modules (guix)) | 351 | (use-modules (guix)) |
| 352 | (with-store store | 352 | (with-store store |
| 353 | (let* ((item (add-to-store store ,base | 353 | (let* ((item (add-to-store store ,(or name base) |
| 354 | ,recursive? | 354 | ,recursive? |
| 355 | "sha256" ,file)) | 355 | "sha256" ,file)) |
| 356 | (root (string-append "/tmp/gc-root-" | 356 | (root (string-append "/tmp/gc-root-" |
| @@ -364,18 +364,25 @@ $(prefix)/etc/openrc\n"))) | |||
| 364 | (object->string code))) | 364 | (object->string code))) |
| 365 | 365 | ||
| 366 | (unless target | 366 | (unless target |
| 367 | (intern (assoc-ref inputs "boot-guile") #f) | 367 | (if (string=? system "x86_64-linux") |
| 368 | 368 | ;; On x86_64 a test needs the i686 Guile. Unfortunately, | |
| 369 | ;; On x86_64 some tests need the i686 Guile. | 369 | ;; their tarballs can have the same input label. |
| 370 | (when (and (not target) | 370 | (for-each |
| 371 | (string=? system "x86_64-linux")) | 371 | (match-lambda |
| 372 | (intern (assoc-ref inputs "boot-guile/i686") #f)) | 372 | ((label . file) |
| 373 | (and (string-prefix? "guile-" label) | ||
| 374 | (string-suffix? ".tar.xz" label) | ||
| 375 | (intern file)))) | ||
| 376 | inputs) | ||
| 377 | (intern (assoc-ref inputs #$(basename | ||
| 378 | (bootstrap-guile-url-path | ||
| 379 | (%current-system)))))) | ||
| 373 | 380 | ||
| 374 | ;; Copy the bootstrap executables. | 381 | ;; Copy the bootstrap executables. |
| 375 | (for-each (lambda (input) | 382 | (for-each (lambda (bin) |
| 376 | (intern (assoc-ref inputs input) #t)) | 383 | (let ((input (string-append "bootstrap-" bin))) |
| 377 | '("bootstrap/bash" "bootstrap/mkdir" | 384 | (intern (assoc-ref inputs input) #t bin))) |
| 378 | "bootstrap/tar" "bootstrap/xz"))))) | 385 | (list "bash" "mkdir" "tar" "xz"))))) |
| 379 | (add-after 'unpack 'disable-failing-tests | 386 | (add-after 'unpack 'disable-failing-tests |
| 380 | ;; XXX FIXME: These tests fail within the build container. | 387 | ;; XXX FIXME: These tests fail within the build container. |
| 381 | (lambda _ | 388 | (lambda _ |
| @@ -490,45 +497,39 @@ $(prefix)/etc/openrc\n"))) | |||
| 490 | help2man | 497 | help2man |
| 491 | po4a-minimal))) | 498 | po4a-minimal))) |
| 492 | (inputs | 499 | (inputs |
| 493 | `(("bash-minimal" ,bash-minimal) | 500 | (append (list bash-minimal |
| 494 | ("bzip2" ,bzip2) | 501 | bzip2 |
| 495 | ("gzip" ,gzip) | 502 | gzip |
| 496 | ("sqlite" ,sqlite) | 503 | sqlite |
| 497 | ("libgcrypt" ,libgcrypt) | 504 | libgcrypt |
| 498 | ("zlib" ,zlib) | 505 | zlib |
| 499 | 506 | guile-3.0-latest | |
| 500 | ("guile" ,guile-3.0-latest) | 507 | ;; Some of the tests use "unshare" when it is available. |
| 501 | 508 | util-linux | |
| 502 | ;; Some of the tests use "unshare" when it is available. | 509 | ;; Tests also rely on these bootstrap executables. |
| 503 | ("util-linux" ,util-linux) | 510 | (bootstrap-executable "bash" (%current-system) "bootstrap-bash") |
| 504 | ,@(if (target-linux?) | 511 | (bootstrap-executable "mkdir" (%current-system) "bootstrap-mkdir") |
| 505 | `(("slirp4netns" ,slirp4netns)) | 512 | (bootstrap-executable "tar" (%current-system) "bootstrap-tar") |
| 506 | '()) | 513 | (bootstrap-executable "xz" (%current-system) "bootstrap-xz") |
| 507 | 514 | disarchive ;for 'guix perform-download' | |
| 508 | ;; Many tests rely on the 'guile-bootstrap' package, which is why we | 515 | guile-bzip2 ;for Disarchive |
| 509 | ;; have it here. | 516 | guile-lzma ;for Disarchive |
| 510 | ("boot-guile" ,(bootstrap-guile-origin (%current-system))) | 517 | git-minimal ;for 'guix perform-download' |
| 511 | ,@(if (and (not (%current-target-system)) | 518 | (libc-utf8-locales-for-target)) |
| 512 | (string=? (%current-system) "x86_64-linux")) | 519 | (if (target-linux?) |
| 513 | `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux"))) | 520 | (list slirp4netns) |
| 514 | '()) | 521 | '()) |
| 515 | ,@(if (%current-target-system) | 522 | ;; Many tests rely on the 'guile-bootstrap' package. |
| 516 | `(("xz" ,xz)) | 523 | (cons* |
| 517 | '()) | 524 | (bootstrap-guile-origin (%current-system)) |
| 518 | 525 | ;; On x86_64 a test needs the i686 Guile. | |
| 519 | ;; Tests also rely on these bootstrap executables. | 526 | (if (and (not (%current-target-system)) |
| 520 | ("bootstrap/bash" ,(bootstrap-executable "bash" (%current-system))) | 527 | (string=? (%current-system) "x86_64-linux")) |
| 521 | ("bootstrap/mkdir" ,(bootstrap-executable "mkdir" (%current-system))) | 528 | (list (bootstrap-guile-origin "i686-linux")) |
| 522 | ("bootstrap/tar" ,(bootstrap-executable "tar" (%current-system))) | 529 | '())) |
| 523 | ("bootstrap/xz" ,(bootstrap-executable "xz" (%current-system))) | 530 | (if (%current-target-system) |
| 524 | 531 | (list xz) | |
| 525 | ("disarchive" ,disarchive) ;for 'guix perform-download' | 532 | '()))) |
| 526 | ("guile-bzip2" ,guile-bzip2) ;for Disarchive | ||
| 527 | ("guile-lzma" ,guile-lzma) ;for Disarchive | ||
| 528 | |||
| 529 | ("git-minimal" ,git-minimal) ;for 'guix perform-download' | ||
| 530 | |||
| 531 | ("glibc-utf8-locales" ,(libc-utf8-locales-for-target)))) | ||
| 532 | (propagated-inputs | 533 | (propagated-inputs |
| 533 | (append (if (target-hurd?) | 534 | (append (if (target-hurd?) |
| 534 | '() | 535 | '() |
| @@ -592,7 +593,9 @@ the Nix package manager.") | |||
| 592 | (delete "po4a" "graphviz" "font-ghostscript" "help2man"))) | 593 | (delete "po4a" "graphviz" "font-ghostscript" "help2man"))) |
| 593 | (inputs | 594 | (inputs |
| 594 | (modify-inputs (package-inputs guix) | 595 | (modify-inputs (package-inputs guix) |
| 595 | (delete "boot-guile" "boot-guile/i686" "util-linux") | 596 | (delete (basename (bootstrap-guile-url-path (%current-system))) |
| 597 | (basename (bootstrap-guile-url-path "i686-linux")) | ||
| 598 | "util-linux") | ||
| 596 | (prepend guile-gnutls guile-git guile-json-4 guile-gcrypt))) | 599 | (prepend guile-gnutls guile-git guile-json-4 guile-gcrypt))) |
| 597 | 600 | ||
| 598 | (propagated-inputs '()) | 601 | (propagated-inputs '()) |
