diff options
| author | Christopher Baines <mail@cbaines.net> | 2023-08-09 09:38:31 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2023-08-18 16:02:34 +0200 |
| commit | 560cb51e7b37e2c6f6fe4b72a3781185c57fdf83 (patch) | |
| tree | 878d5c4490672db6dbd872f5745a763fcd87beb6 /gnu/ci.scm | |
| parent | 10f3dd0e9e06d71d1bc1615c6a60cc3aa1ad1ff4 (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/ci.scm')
| -rw-r--r-- | gnu/ci.scm | 46 |
1 files changed, 25 insertions, 21 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 | ||
| 356 | valid. Append SUFFIX to the job name." | 360 | valid. 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. |
