summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-08-09 09:38:31 +0200
committerLudovic Courtès <ludo@gnu.org>2023-08-18 16:02:34 +0200
commit560cb51e7b37e2c6f6fe4b72a3781185c57fdf83 (patch)
tree878d5c4490672db6dbd872f5745a763fcd87beb6 /gnu
parent10f3dd0e9e06d71d1bc1615c6a60cc3aa1ad1ff4 (diff)
gnu: commencement: Use system in %final-inputs.
Otherwise this causes odd issues, I presume arising from when %current-system differs from the system argument passed to %final-inputs. * gnu/packages/commencement.scm (%final-inputs): Set %current-system to system. * gnu/packages/base.scm (%final-inputs): Add optional system parameter. * gnu/ci.scm (base-packages): New procedure to memoize the base packages depending on system. (package->job): Pass system to base-packages. Co-authored-by: Josselin Poiret <dev@jpoiret.xyz> Signed-off-by: Josselin Poiret <dev@jpoiret.xyz> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/ci.scm46
-rw-r--r--gnu/packages/base.scm7
-rw-r--r--gnu/packages/commencement.scm51
3 files changed, 55 insertions, 49 deletions
diff --git a/gnu/ci.scm b/gnu/ci.scm
index 7acd88ed29b..df98c8af972 100644
--- a/gnu/ci.scm
+++ b/gnu/ci.scm
@@ -24,6 +24,7 @@
24 #:use-module (guix build-system channel) 24 #:use-module (guix build-system channel)
25 #:use-module (guix config) 25 #:use-module (guix config)
26 #:autoload (guix describe) (package-channels) 26 #:autoload (guix describe) (package-channels)
27 #:use-module (guix memoization)
27 #:use-module (guix store) 28 #:use-module (guix store)
28 #:use-module (guix profiles) 29 #:use-module (guix profiles)
29 #:use-module (guix packages) 30 #:use-module (guix packages)
@@ -342,29 +343,32 @@ otherwise use the IMAGE name."
342 ;; Return the name of a package's job. 343 ;; Return the name of a package's job.
343 package-name) 344 package-name)
344 345
346(define base-packages
347 (mlambda (system)
348 "Return the set of packages considered to be part of the base for SYSTEM."
349 (delete-duplicates
350 (append-map (match-lambda
351 ((_ package _ ...)
352 (match (package-transitive-inputs package)
353 (((_ inputs _ ...) ...)
354 inputs))))
355 (%final-inputs system)))))
356
345(define package->job 357(define package->job
346 (let ((base-packages 358 (lambda* (store package system #:key (suffix ""))
347 (delete-duplicates 359 "Return a job for PACKAGE on SYSTEM, or #f if this combination is not
348 (append-map (match-lambda
349 ((_ package _ ...)
350 (match (package-transitive-inputs package)
351 (((_ inputs _ ...) ...)
352 inputs))))
353 (%final-inputs)))))
354 (lambda* (store package system #:key (suffix ""))
355 "Return a job for PACKAGE on SYSTEM, or #f if this combination is not
356valid. Append SUFFIX to the job name." 360valid. Append SUFFIX to the job name."
357 (cond ((member package base-packages) 361 (cond ((member package (base-packages system))
358 (package-job store (string-append "base." (job-name package)) 362 (package-job store (string-append "base." (job-name package))
359 package system #:suffix suffix)) 363 package system #:suffix suffix))
360 ((supported-package? package system) 364 ((supported-package? package system)
361 (let ((drv (package-derivation store package system 365 (let ((drv (package-derivation store package system
362 #:graft? #f))) 366 #:graft? #f)))
363 (and (substitutable-derivation? drv) 367 (and (substitutable-derivation? drv)
364 (package-job store (job-name package) 368 (package-job store (job-name package)
365 package system #:suffix suffix)))) 369 package system #:suffix suffix))))
366 (else 370 (else
367 #f))))) 371 #f))))
368 372
369(define %x86-64-micro-architectures 373(define %x86-64-micro-architectures
370 ;; Micro-architectures for which we build tuned variants. 374 ;; Micro-architectures for which we build tuned variants.
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 1fdfaf8a57e..32bc69e2c44 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -78,7 +78,8 @@
78 #:export (glibc 78 #:export (glibc
79 libc-for-target 79 libc-for-target
80 make-ld-wrapper 80 make-ld-wrapper
81 libiconv-if-needed)) 81 libiconv-if-needed
82 %final-inputs))
82 83
83;;; Commentary: 84;;; Commentary:
84;;; 85;;;
@@ -1648,10 +1649,10 @@ package needs iconv ,@(libiconv-if-needed) should be added."
1648 (proc (module-ref iface 'canonical-package))) 1649 (proc (module-ref iface 'canonical-package)))
1649 (proc package))) 1650 (proc package)))
1650 1651
1651(define-public (%final-inputs) 1652(define* (%final-inputs #:optional (system (%current-system)))
1652 "Return the list of \"final inputs\"." 1653 "Return the list of \"final inputs\"."
1653 ;; Avoid circular dependency by lazily resolving 'commencement'. 1654 ;; Avoid circular dependency by lazily resolving 'commencement'.
1654 (let ((iface (resolve-interface '(gnu packages commencement)))) 1655 (let ((iface (resolve-interface '(gnu packages commencement))))
1655 ((module-ref iface '%final-inputs) (%current-system)))) 1656 ((module-ref iface '%final-inputs) system)))
1656 1657
1657;;; base.scm ends here 1658;;; base.scm ends here
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index fe6f0252571..e522e70444e 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3459,31 +3459,32 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
3459 ;; still use 'package-with-bootstrap-guile' so that the bootstrap tools are 3459 ;; still use 'package-with-bootstrap-guile' so that the bootstrap tools are
3460 ;; used for origins that have patches, thereby avoiding circular 3460 ;; used for origins that have patches, thereby avoiding circular
3461 ;; dependencies. 3461 ;; dependencies.
3462 (let ((finalize (compose with-boot6 3462 (parameterize ((%current-system system))
3463 package-with-bootstrap-guile))) 3463 (let ((finalize (compose with-boot6
3464 `(,@(map (match-lambda 3464 package-with-bootstrap-guile)))
3465 ((name package) 3465 `(,@(map (match-lambda
3466 (list name (finalize package)))) 3466 ((name package)
3467 `(("tar" ,tar) 3467 (list name (finalize package))))
3468 ("gzip" ,gzip) 3468 `(("tar" ,tar)
3469 ("bzip2" ,bzip2) 3469 ("gzip" ,gzip)
3470 ("file" ,file) 3470 ("bzip2" ,bzip2)
3471 ("diffutils" ,diffutils) 3471 ("file" ,file)
3472 ("patch" ,patch) 3472 ("diffutils" ,diffutils)
3473 ("findutils" ,findutils) 3473 ("patch" ,patch)
3474 ("gawk" ,gawk))) 3474 ("findutils" ,findutils)
3475 ("sed" ,sed-final) 3475 ("gawk" ,gawk)))
3476 ("grep" ,grep-final) 3476 ("sed" ,sed-final)
3477 ("xz" ,xz-final) 3477 ("grep" ,grep-final)
3478 ("coreutils" ,coreutils-final) 3478 ("xz" ,xz-final)
3479 ("make" ,gnu-make-final) 3479 ("coreutils" ,coreutils-final)
3480 ("bash" ,bash-final) 3480 ("make" ,gnu-make-final)
3481 ("ld-wrapper" ,ld-wrapper) 3481 ("bash" ,bash-final)
3482 ("binutils" ,binutils-final) 3482 ("ld-wrapper" ,ld-wrapper)
3483 ("gcc" ,gcc-final) 3483 ("binutils" ,binutils-final)
3484 ("libc" ,glibc-final) 3484 ("gcc" ,gcc-final)
3485 ("libc:static" ,glibc-final "static") 3485 ("libc" ,glibc-final)
3486 ("locales" ,glibc-utf8-locales-final))))) 3486 ("libc:static" ,glibc-final "static")
3487 ("locales" ,glibc-utf8-locales-final))))))
3487 3488
3488(define-public canonical-package 3489(define-public canonical-package
3489 (let ((name->package (mlambda (system) 3490 (let ((name->package (mlambda (system)