diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2021-12-04 19:01:14 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2022-01-01 15:23:24 +0100 |
| commit | 6756c64a8f1a22f74ea3bcb8bfb00f229ad6f6c5 (patch) | |
| tree | ce34ca8754920cde6b9e59c1fc3a48948efd5b1f /gnu/ci.scm | |
| parent | d090e9c37d693f5a0f381482c17fb03462cb6a48 (diff) | |
ci: Add extra jobs for tunable packages.
This allows us to provide substitutes for tuned package variants.
* gnu/ci.scm (package-job): Add #:suffix and honor it.
(package->job): Add #:suffix and honor it.
(%x86-64-micro-architectures): New variable.
(tuned-package-jobs): New procedure.
(cuirass-jobs): Add jobs for tunable packages.
Diffstat (limited to 'gnu/ci.scm')
| -rw-r--r-- | gnu/ci.scm | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/gnu/ci.scm b/gnu/ci.scm index 6039af8f076..35fd583f754 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #:use-module (guix grafts) | 28 | #:use-module (guix grafts) |
| 29 | #:use-module (guix profiles) | 29 | #:use-module (guix profiles) |
| 30 | #:use-module (guix packages) | 30 | #:use-module (guix packages) |
| 31 | #:autoload (guix transformations) (tunable-package? tuned-package) | ||
| 31 | #:use-module (guix channels) | 32 | #:use-module (guix channels) |
| 32 | #:use-module (guix config) | 33 | #:use-module (guix config) |
| 33 | #:use-module (guix derivations) | 34 | #:use-module (guix derivations) |
| @@ -107,9 +108,9 @@ building the derivation." | |||
| 107 | (#:timeout . ,timeout))) | 108 | (#:timeout . ,timeout))) |
| 108 | 109 | ||
| 109 | (define* (package-job store job-name package system | 110 | (define* (package-job store job-name package system |
| 110 | #:key cross? target) | 111 | #:key cross? target (suffix "")) |
| 111 | "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." | 112 | "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." |
| 112 | (let ((job-name (string-append job-name "." system))) | 113 | (let ((job-name (string-append job-name "." system suffix))) |
| 113 | (parameterize ((%graft? #f)) | 114 | (parameterize ((%graft? #f)) |
| 114 | (let* ((drv (if cross? | 115 | (let* ((drv (if cross? |
| 115 | (package-cross-derivation store package target system | 116 | (package-cross-derivation store package target system |
| @@ -395,21 +396,39 @@ otherwise use the IMAGE name." | |||
| 395 | (((_ inputs _ ...) ...) | 396 | (((_ inputs _ ...) ...) |
| 396 | inputs)))) | 397 | inputs)))) |
| 397 | (%final-inputs))))) | 398 | (%final-inputs))))) |
| 398 | (lambda (store package system) | 399 | (lambda* (store package system #:key (suffix "")) |
| 399 | "Return a job for PACKAGE on SYSTEM, or #f if this combination is not | 400 | "Return a job for PACKAGE on SYSTEM, or #f if this combination is not |
| 400 | valid." | 401 | valid. Append SUFFIX to the job name." |
| 401 | (cond ((member package base-packages) | 402 | (cond ((member package base-packages) |
| 402 | (package-job store (string-append "base." (job-name package)) | 403 | (package-job store (string-append "base." (job-name package)) |
| 403 | package system)) | 404 | package system #:suffix suffix)) |
| 404 | ((supported-package? package system) | 405 | ((supported-package? package system) |
| 405 | (let ((drv (package-derivation store package system | 406 | (let ((drv (package-derivation store package system |
| 406 | #:graft? #f))) | 407 | #:graft? #f))) |
| 407 | (and (substitutable-derivation? drv) | 408 | (and (substitutable-derivation? drv) |
| 408 | (package-job store (job-name package) | 409 | (package-job store (job-name package) |
| 409 | package system)))) | 410 | package system #:suffix suffix)))) |
| 410 | (else | 411 | (else |
| 411 | #f))))) | 412 | #f))))) |
| 412 | 413 | ||
| 414 | (define %x86-64-micro-architectures | ||
| 415 | ;; Micro-architectures for which we build tuned variants. | ||
| 416 | '("westmere" "ivybridge" "haswell" "skylake" "skylake-avx512")) | ||
| 417 | |||
| 418 | (define (tuned-package-jobs store package system) | ||
| 419 | "Return a list of jobs for PACKAGE tuned for SYSTEM's micro-architectures." | ||
| 420 | (filter-map (lambda (micro-architecture) | ||
| 421 | (define suffix | ||
| 422 | (string-append "." micro-architecture)) | ||
| 423 | |||
| 424 | (package->job store | ||
| 425 | (tuned-package package micro-architecture) | ||
| 426 | system | ||
| 427 | #:suffix suffix)) | ||
| 428 | (match system | ||
| 429 | ("x86_64-linux" %x86-64-micro-architectures) | ||
| 430 | (_ '())))) | ||
| 431 | |||
| 413 | (define (all-packages) | 432 | (define (all-packages) |
| 414 | "Return the list of packages to build." | 433 | "Return the list of packages to build." |
| 415 | (define (adjust package result) | 434 | (define (adjust package result) |
| @@ -527,10 +546,16 @@ names." | |||
| 527 | ('all | 546 | ('all |
| 528 | ;; Build everything, including replacements. | 547 | ;; Build everything, including replacements. |
| 529 | (let ((all (all-packages)) | 548 | (let ((all (all-packages)) |
| 530 | (job (lambda (package) | 549 | (jobs (lambda (package) |
| 531 | (package->job store package system)))) | 550 | (match (package->job store package system) |
| 551 | (#f '()) | ||
| 552 | (main-job | ||
| 553 | (cons main-job | ||
| 554 | (if (tunable-package? package) | ||
| 555 | (tuned-package-jobs store package system) | ||
| 556 | '()))))))) | ||
| 532 | (append | 557 | (append |
| 533 | (filter-map job all) | 558 | (append-map jobs all) |
| 534 | (cross-jobs store system)))) | 559 | (cross-jobs store system)))) |
| 535 | ('core | 560 | ('core |
| 536 | ;; Build core packages only. | 561 | ;; Build core packages only. |
