Commit | Line | Data |
---|---|---|
59fb5c1c | 1 | ;;; GNU Guix --- Functional package management for GNU |
2032d847 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> |
db2785cd | 3 | ;;; Copyright © 2017, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> |
f71b0a00 | 4 | ;;; Copyright © 2018, 2019 Clément Lassieur <clement@lassieur.org> |
f43ec1c5 | 5 | ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu> |
76bea3f8 | 6 | ;;; Copyright © 2020, 2021 Mathieu Othacehe <othacehe@gnu.org> |
59fb5c1c LC |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
11 | ;;; under the terms of the GNU General Public License as published by | |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | (define-module (gnu ci) | |
76bea3f8 | 24 | #:use-module (guix channels) |
59fb5c1c | 25 | #:use-module (guix config) |
61a11653 | 26 | #:use-module (guix describe) |
59fb5c1c LC |
27 | #:use-module (guix store) |
28 | #:use-module (guix grafts) | |
29 | #:use-module (guix profiles) | |
30 | #:use-module (guix packages) | |
7e6d8d36 | 31 | #:use-module (guix channels) |
f43ec1c5 | 32 | #:use-module (guix config) |
59fb5c1c | 33 | #:use-module (guix derivations) |
7e6d8d36 | 34 | #:use-module (guix build-system) |
59fb5c1c | 35 | #:use-module (guix monads) |
dd1ee160 | 36 | #:use-module (guix gexp) |
59fb5c1c | 37 | #:use-module (guix ui) |
b5f8c2c8 LC |
38 | #:use-module ((guix licenses) |
39 | #:select (gpl3+ license? license-name)) | |
59fb5c1c LC |
40 | #:use-module ((guix utils) #:select (%current-system)) |
41 | #:use-module ((guix scripts system) #:select (read-operating-system)) | |
42 | #:use-module ((guix scripts pack) | |
43 | #:select (lookup-compressor self-contained-tarball)) | |
44 | #:use-module (gnu bootloader) | |
45 | #:use-module (gnu bootloader u-boot) | |
f19cf27c | 46 | #:use-module (gnu image) |
59fb5c1c LC |
47 | #:use-module (gnu packages) |
48 | #:use-module (gnu packages gcc) | |
49 | #:use-module (gnu packages base) | |
50 | #:use-module (gnu packages gawk) | |
51 | #:use-module (gnu packages guile) | |
52 | #:use-module (gnu packages gettext) | |
53 | #:use-module (gnu packages compression) | |
54 | #:use-module (gnu packages multiprecision) | |
55 | #:use-module (gnu packages make-bootstrap) | |
56 | #:use-module (gnu packages package-management) | |
57 | #:use-module (gnu system) | |
f19cf27c | 58 | #:use-module (gnu system image) |
59fb5c1c LC |
59 | #:use-module (gnu system vm) |
60 | #:use-module (gnu system install) | |
b06ba9e0 | 61 | #:use-module (gnu system images hurd) |
846e5240 | 62 | #:use-module (gnu system images novena) |
8a4f1eef | 63 | #:use-module (gnu system images pine64) |
17d9a91e | 64 | #:use-module (gnu system images pinebook-pro) |
59fb5c1c LC |
65 | #:use-module (gnu tests) |
66 | #:use-module (srfi srfi-1) | |
67 | #:use-module (srfi srfi-26) | |
68 | #:use-module (ice-9 match) | |
76bea3f8 MO |
69 | #:export (%core-packages |
70 | %cross-targets | |
f292c501 | 71 | channel-source->package |
76bea3f8 | 72 | cuirass-jobs)) |
59fb5c1c LC |
73 | |
74 | ;;; Commentary: | |
75 | ;;; | |
76bea3f8 | 76 | ;;; This file defines build jobs for Cuirass. |
59fb5c1c LC |
77 | ;;; |
78 | ;;; Code: | |
79 | ||
76bea3f8 MO |
80 | (define* (derivation->job name drv |
81 | #:key | |
76bea3f8 MO |
82 | (max-silent-time 3600) |
83 | (timeout 3600)) | |
14ada964 | 84 | "Return a Cuirass job called NAME and describing DRV. |
76bea3f8 MO |
85 | |
86 | MAX-SILENT-TIME and TIMEOUT are build options passed to the daemon when | |
87 | building the derivation." | |
88 | `((#:job-name . ,name) | |
89 | (#:derivation . ,(derivation-file-name drv)) | |
90 | (#:outputs . ,(filter-map | |
91 | (lambda (res) | |
92 | (match res | |
93 | ((name . path) | |
94 | `(,name . ,path)))) | |
95 | (derivation->output-paths drv))) | |
96 | (#:nix-name . ,(derivation-name drv)) | |
97 | (#:system . ,(derivation-system drv)) | |
76bea3f8 MO |
98 | (#:max-silent-time . ,max-silent-time) |
99 | (#:timeout . ,timeout))) | |
100 | ||
101 | (define* (package-job store job-name package system | |
102 | #:key cross? target) | |
59fb5c1c | 103 | "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." |
76bea3f8 MO |
104 | (let ((job-name (string-append job-name "." system))) |
105 | (parameterize ((%graft? #f)) | |
106 | (let* ((drv (if cross? | |
107 | (package-cross-derivation store package target system | |
108 | #:graft? #f) | |
109 | (package-derivation store package system | |
110 | #:graft? #f))) | |
111 | (max-silent-time (or (assoc-ref (package-properties package) | |
112 | 'max-silent-time) | |
113 | 3600)) | |
114 | (timeout (or (assoc-ref (package-properties package) | |
115 | 'timeout) | |
116 | 72000))) | |
117 | (derivation->job job-name drv | |
118 | #:max-silent-time max-silent-time | |
119 | #:timeout timeout))))) | |
59fb5c1c LC |
120 | |
121 | (define (package-cross-job store job-name package target system) | |
122 | "Return a job called TARGET.JOB-NAME that cross-builds PACKAGE for TARGET on | |
123 | SYSTEM." | |
76bea3f8 MO |
124 | (let ((name (string-append target "." job-name "." system))) |
125 | (package-job store name package system | |
126 | #:cross? #t | |
127 | #:target target))) | |
59fb5c1c LC |
128 | |
129 | (define %core-packages | |
130 | ;; Note: Don't put the '-final' package variants because (1) that's | |
131 | ;; implicit, and (2) they cannot be cross-built (due to the explicit input | |
132 | ;; chain.) | |
84f38f03 | 133 | (list gcc-7 gcc-8 gcc-9 gcc-10 glibc binutils |
59fb5c1c LC |
134 | gmp mpfr mpc coreutils findutils diffutils patch sed grep |
135 | gawk gnu-gettext hello guile-2.0 guile-2.2 zlib gzip xz | |
136 | %bootstrap-binaries-tarball | |
137 | %binutils-bootstrap-tarball | |
138 | (%glibc-bootstrap-tarball) | |
139 | %gcc-bootstrap-tarball | |
140 | %guile-bootstrap-tarball | |
141 | %bootstrap-tarballs)) | |
142 | ||
668a5198 LC |
143 | (define (packages-to-cross-build target) |
144 | "Return the list of packages to cross-build for TARGET." | |
145 | ;; Don't cross-build the bootstrap tarballs for MinGW. | |
146 | (if (string-contains target "mingw") | |
147 | (drop-right %core-packages 6) | |
148 | %core-packages)) | |
59fb5c1c LC |
149 | |
150 | (define %cross-targets | |
151 | '("mips64el-linux-gnu" | |
59fb5c1c LC |
152 | "arm-linux-gnueabihf" |
153 | "aarch64-linux-gnu" | |
154 | "powerpc-linux-gnu" | |
8d9aece8 | 155 | "powerpc64le-linux-gnu" |
2032d847 | 156 | "riscv64-linux-gnu" |
59fb5c1c | 157 | "i586-pc-gnu" ;aka. GNU/Hurd |
67dac6b8 CD |
158 | "i686-w64-mingw32" |
159 | "x86_64-w64-mingw32")) | |
59fb5c1c | 160 | |
3046e73b LC |
161 | (define (cross-jobs store system) |
162 | "Return a list of cross-compilation jobs for SYSTEM." | |
163 | (define (from-32-to-64? target) | |
164 | ;; Return true if SYSTEM is 32-bit and TARGET is 64-bit. This hack | |
165 | ;; prevents known-to-fail cross-builds from i686-linux or armhf-linux to | |
166 | ;; mips64el-linux-gnuabi64. | |
167 | (and (or (string-prefix? "i686-" system) | |
168 | (string-prefix? "i586-" system) | |
169 | (string-prefix? "armhf-" system)) | |
170 | (string-contains target "64"))) ;x86_64, mips64el, aarch64, etc. | |
171 | ||
172 | (define (same? target) | |
173 | ;; Return true if SYSTEM and TARGET are the same thing. This is so we | |
174 | ;; don't try to cross-compile to 'mips64el-linux-gnu' from | |
175 | ;; 'mips64el-linux'. | |
176 | (or (string-contains target system) | |
177 | (and (string-prefix? "armhf" system) ;armhf-linux | |
178 | (string-prefix? "arm" target)))) ;arm-linux-gnueabihf | |
179 | ||
180 | (define (pointless? target) | |
181 | ;; Return #t if it makes no sense to cross-build to TARGET from SYSTEM. | |
182 | (match system | |
183 | ((or "x86_64-linux" "i686-linux") | |
184 | (if (string-contains target "mingw") | |
185 | (not (string=? "x86_64-linux" system)) | |
186 | #f)) | |
187 | (_ | |
188 | ;; Don't try to cross-compile from non-Intel platforms: this isn't | |
189 | ;; very useful and these are often brittle configurations. | |
190 | #t))) | |
191 | ||
192 | (define (either proc1 proc2 proc3) | |
193 | (lambda (x) | |
194 | (or (proc1 x) (proc2 x) (proc3 x)))) | |
195 | ||
196 | (append-map (lambda (target) | |
197 | (map (lambda (package) | |
198 | (package-cross-job store (job-name package) | |
199 | package target system)) | |
50b99c90 | 200 | (packages-to-cross-build target))) |
3046e73b LC |
201 | (remove (either from-32-to-64? same? pointless?) |
202 | %cross-targets))) | |
203 | ||
76bea3f8 MO |
204 | (define* (guix-jobs store systems #:key source commit) |
205 | "Return a list of jobs for Guix itself." | |
206 | (define build | |
207 | (primitive-load (string-append source "/build-aux/build-self.scm"))) | |
208 | ||
209 | (map | |
210 | (lambda (system) | |
211 | (let ((name (string->symbol | |
212 | (string-append "guix." system))) | |
213 | (drv (run-with-store store | |
214 | (build source #:version commit #:system system | |
215 | #:pull-version 1 | |
216 | #:guile-version "2.2")))) | |
217 | (derivation->job name drv))) | |
218 | systems)) | |
219 | ||
b06ba9e0 MO |
220 | ;; Architectures that are able to build or cross-build Guix System images. |
221 | ;; This does not mean that other architectures are not supported, only that | |
222 | ;; they are often not fast enough to support Guix System images building. | |
223 | (define %guix-system-supported-systems | |
224 | '("x86_64-linux" "i686-linux")) | |
59fb5c1c | 225 | |
b06ba9e0 | 226 | (define %guix-system-images |
8a4f1eef | 227 | (list hurd-barebones-qcow2-image |
17d9a91e | 228 | pine64-barebones-raw-image |
846e5240 DM |
229 | pinebook-pro-barebones-raw-image |
230 | novena-barebones-raw-image)) | |
59fb5c1c | 231 | |
fc2fa7ad MO |
232 | (define (hours hours) |
233 | (* 3600 hours)) | |
234 | ||
b06ba9e0 | 235 | (define (image-jobs store system) |
14ada964 | 236 | "Return a list of jobs that build images for SYSTEM." |
59fb5c1c | 237 | (define (->job name drv) |
76bea3f8 MO |
238 | (let ((name (string-append name "." system))) |
239 | (parameterize ((%graft? #f)) | |
14ada964 | 240 | (derivation->job name drv)))) |
59fb5c1c | 241 | |
b06ba9e0 MO |
242 | (define (build-image image) |
243 | (run-with-store store | |
244 | (mbegin %store-monad | |
245 | (set-guile-for-build (default-guile)) | |
246 | (lower-object (system-image image))))) | |
247 | ||
59fb5c1c LC |
248 | (define MiB |
249 | (expt 2 20)) | |
250 | ||
b06ba9e0 | 251 | (if (member system %guix-system-supported-systems) |
76bea3f8 | 252 | `(,(->job "usb-image" |
b06ba9e0 MO |
253 | (build-image |
254 | (image | |
255 | (inherit efi-disk-image) | |
b06ba9e0 | 256 | (operating-system installation-os)))) |
76bea3f8 | 257 | ,(->job "iso9660-image" |
b06ba9e0 MO |
258 | (build-image |
259 | (image | |
f43ec1c5 | 260 | (inherit (image-with-label |
76bea3f8 MO |
261 | iso9660-image |
262 | (string-append "GUIX_" system "_" | |
263 | (if (> (string-length %guix-version) 7) | |
264 | (substring %guix-version 0 7) | |
265 | %guix-version)))) | |
b06ba9e0 MO |
266 | (operating-system installation-os)))) |
267 | ;; Only cross-compile Guix System images from x86_64-linux for now. | |
268 | ,@(if (string=? system "x86_64-linux") | |
269 | (map (lambda (image) | |
76bea3f8 MO |
270 | (->job (symbol->string (image-name image)) |
271 | (build-image image))) | |
b06ba9e0 MO |
272 | %guix-system-images) |
273 | '())) | |
1189f405 | 274 | '())) |
59fb5c1c | 275 | |
7e6d8d36 LC |
276 | (define channel-build-system |
277 | ;; Build system used to "convert" a channel instance to a package. | |
278 | (let* ((build (lambda* (store name inputs | |
dd1ee160 | 279 | #:key source commit system |
c3ab921e | 280 | #:allow-other-keys) |
7e6d8d36 | 281 | (run-with-store store |
bc8b2ffd LC |
282 | ;; SOURCE can be a lowerable object such as <local-file> |
283 | ;; or a file name. Adjust accordingly. | |
284 | (mlet* %store-monad ((source (if (string? source) | |
285 | (return source) | |
286 | (lower-object source))) | |
dd1ee160 LC |
287 | (instance |
288 | -> (checkout->channel-instance | |
289 | source #:commit commit))) | |
290 | (channel-instances->derivation (list instance))) | |
c3ab921e | 291 | #:system system))) |
dd1ee160 LC |
292 | (lower (lambda* (name #:key system source commit |
293 | #:allow-other-keys) | |
7e6d8d36 LC |
294 | (bag |
295 | (name name) | |
296 | (system system) | |
297 | (build build) | |
dd1ee160 LC |
298 | (arguments `(#:source ,source |
299 | #:commit ,commit)))))) | |
7e6d8d36 LC |
300 | (build-system (name 'channel) |
301 | (description "Turn a channel instance into a package.") | |
302 | (lower lower)))) | |
303 | ||
dd1ee160 LC |
304 | (define* (channel-source->package source #:key commit) |
305 | "Return a package for the given channel SOURCE, a lowerable object." | |
7e6d8d36 LC |
306 | (package |
307 | (inherit guix) | |
dd1ee160 | 308 | (version (string-append (package-version guix) "+")) |
7e6d8d36 | 309 | (build-system channel-build-system) |
dd1ee160 LC |
310 | (arguments `(#:source ,source |
311 | #:commit ,commit)) | |
7e6d8d36 LC |
312 | (inputs '()) |
313 | (native-inputs '()) | |
314 | (propagated-inputs '()))) | |
315 | ||
316 | (define* (system-test-jobs store system | |
317 | #:key source commit) | |
59fb5c1c | 318 | "Return a list of jobs for the system tests." |
59fb5c1c | 319 | (define (->job test) |
fc37346f MO |
320 | (let ((name (string-append "test." (system-test-name test) |
321 | "." system)) | |
322 | (drv (run-with-store store | |
323 | (mbegin %store-monad | |
324 | (set-current-system system) | |
325 | (set-grafting #f) | |
326 | (set-guile-for-build (default-guile)) | |
327 | (system-test-value test))))) | |
76bea3f8 | 328 | |
fc37346f | 329 | (derivation->job name drv))) |
59fb5c1c | 330 | |
b06ba9e0 | 331 | (if (member system %guix-system-supported-systems) |
7e6d8d36 LC |
332 | ;; Override the value of 'current-guix' used by system tests. Using a |
333 | ;; channel instance makes tests that rely on 'current-guix' less | |
334 | ;; expensive. It also makes sure we get a valid Guix package when this | |
335 | ;; code is not running from a checkout. | |
fc37346f MO |
336 | (parameterize ((current-guix-package |
337 | (channel-source->package source #:commit commit))) | |
338 | (map ->job (all-system-tests))) | |
59fb5c1c LC |
339 | '())) |
340 | ||
341 | (define (tarball-jobs store system) | |
76bea3f8 | 342 | "Return jobs to build the self-contained Guix binary tarball." |
59fb5c1c | 343 | (define (->job name drv) |
76bea3f8 MO |
344 | (let ((name (string-append name "." system))) |
345 | (parameterize ((%graft? #f)) | |
14ada964 | 346 | (derivation->job name drv)))) |
59fb5c1c LC |
347 | |
348 | ;; XXX: Add a job for the stable Guix? | |
76bea3f8 MO |
349 | (list |
350 | (->job "binary-tarball" | |
351 | (run-with-store store | |
352 | (mbegin %store-monad | |
353 | (set-guile-for-build (default-guile)) | |
354 | (>>= (profile-derivation (packages->manifest (list guix))) | |
355 | (lambda (profile) | |
356 | (self-contained-tarball "guix-binary" profile | |
357 | #:localstatedir? #t | |
358 | #:compressor | |
359 | (lookup-compressor "xz"))))) | |
360 | #:system system)))) | |
59fb5c1c LC |
361 | |
362 | (define job-name | |
363 | ;; Return the name of a package's job. | |
76bea3f8 | 364 | package-name) |
59fb5c1c LC |
365 | |
366 | (define package->job | |
367 | (let ((base-packages | |
368 | (delete-duplicates | |
369 | (append-map (match-lambda | |
76bea3f8 MO |
370 | ((_ package _ ...) |
371 | (match (package-transitive-inputs package) | |
372 | (((_ inputs _ ...) ...) | |
373 | inputs)))) | |
59fb5c1c LC |
374 | (%final-inputs))))) |
375 | (lambda (store package system) | |
376 | "Return a job for PACKAGE on SYSTEM, or #f if this combination is not | |
377 | valid." | |
378 | (cond ((member package base-packages) | |
76bea3f8 | 379 | (package-job store (string-append "base." (job-name package)) |
59fb5c1c LC |
380 | package system)) |
381 | ((supported-package? package system) | |
382 | (let ((drv (package-derivation store package system | |
383 | #:graft? #f))) | |
384 | (and (substitutable-derivation? drv) | |
385 | (package-job store (job-name package) | |
386 | package system)))) | |
387 | (else | |
388 | #f))))) | |
389 | ||
390 | (define (all-packages) | |
391 | "Return the list of packages to build." | |
392 | (define (adjust package result) | |
393 | (cond ((package-replacement package) | |
f00ff8db LC |
394 | ;; XXX: If PACKAGE and its replacement have the same name/version, |
395 | ;; then both Cuirass jobs will have the same name, which | |
396 | ;; effectively means that the second one will be ignored. Thus, | |
397 | ;; return the replacement first. | |
398 | (cons* (package-replacement package) ;build both | |
399 | package | |
59fb5c1c LC |
400 | result)) |
401 | ((package-superseded package) | |
402 | result) ;don't build it | |
403 | (else | |
404 | (cons package result)))) | |
405 | ||
406 | (fold-packages adjust | |
407 | (fold adjust '() ;include base packages | |
408 | (match (%final-inputs) | |
409 | (((labels packages _ ...) ...) | |
410 | packages))) | |
411 | #:select? (const #t))) ;include hidden packages | |
412 | ||
76bea3f8 | 413 | (define (arguments->manifests arguments channels) |
59fb5c1c | 414 | "Return the list of manifests extracted from ARGUMENTS." |
862af8c2 MO |
415 | (map (lambda (manifest) |
416 | (any (lambda (checkout) | |
417 | (let ((path (in-vicinity checkout manifest))) | |
418 | (and (file-exists? path) | |
419 | path))) | |
420 | (map channel-url channels))) | |
76bea3f8 | 421 | arguments)) |
59fb5c1c LC |
422 | |
423 | (define (manifests->packages store manifests) | |
424 | "Return the list of packages found in MANIFESTS." | |
425 | (define (load-manifest manifest) | |
426 | (save-module-excursion | |
427 | (lambda () | |
428 | (set-current-module (make-user-module '((guix profiles) (gnu)))) | |
429 | (primitive-load manifest)))) | |
430 | ||
431 | (delete-duplicates! | |
432 | (map manifest-entry-item | |
433 | (append-map (compose manifest-entries | |
434 | load-manifest) | |
435 | manifests)))) | |
436 | ||
437 | \f | |
438 | ;;; | |
76bea3f8 | 439 | ;;; Cuirass entry point. |
59fb5c1c LC |
440 | ;;; |
441 | ||
76bea3f8 MO |
442 | (define (cuirass-jobs store arguments) |
443 | "Register Cuirass jobs." | |
59fb5c1c | 444 | (define subset |
76bea3f8 | 445 | (assoc-ref arguments 'subset)) |
59fb5c1c LC |
446 | |
447 | (define systems | |
448 | (match (assoc-ref arguments 'systems) | |
76bea3f8 | 449 | (#f %cuirass-supported-systems) |
59fb5c1c LC |
450 | ((lst ...) lst) |
451 | ((? string? str) (call-with-input-string str read)))) | |
452 | ||
76bea3f8 MO |
453 | (define channels |
454 | (let ((channels (assq-ref arguments 'channels))) | |
455 | (map sexp->channel channels))) | |
456 | ||
457 | (define guix | |
458 | (find guix-channel? channels)) | |
7e6d8d36 LC |
459 | |
460 | (define commit | |
76bea3f8 | 461 | (channel-commit guix)) |
7e6d8d36 LC |
462 | |
463 | (define source | |
76bea3f8 | 464 | (channel-url guix)) |
7e6d8d36 | 465 | |
59fb5c1c LC |
466 | ;; Turn off grafts. Grafting is meant to happen on the user's machines. |
467 | (parameterize ((%graft? #f)) | |
468 | ;; Return one job for each package, except bootstrap packages. | |
76bea3f8 MO |
469 | (append-map |
470 | (lambda (system) | |
471 | (format (current-error-port) | |
472 | "evaluating for '~a' (heap size: ~a MiB)...~%" | |
473 | system | |
474 | (round | |
475 | (/ (assoc-ref (gc-stats) 'heap-size) | |
476 | (expt 2. 20)))) | |
477 | (invalidate-derivation-caches!) | |
478 | (match subset | |
479 | ('all | |
480 | ;; Build everything, including replacements. | |
481 | (let ((all (all-packages)) | |
482 | (job (lambda (package) | |
483 | (package->job store package system)))) | |
484 | (append | |
485 | (filter-map job all) | |
76bea3f8 MO |
486 | (cross-jobs store system)))) |
487 | ('core | |
488 | ;; Build core packages only. | |
489 | (append | |
490 | (map (lambda (package) | |
491 | (package-job store (job-name package) | |
492 | package system)) | |
493 | %core-packages) | |
494 | (cross-jobs store system))) | |
495 | ('guix | |
496 | ;; Build Guix modules only. | |
497 | (guix-jobs store systems | |
498 | #:source source | |
499 | #:commit commit)) | |
500 | ('hello | |
501 | ;; Build hello package only. | |
502 | (let ((hello (specification->package "hello"))) | |
503 | (list (package-job store (job-name hello) | |
504 | hello system)))) | |
2afc79b5 MO |
505 | ('images |
506 | ;; Build Guix System images only. | |
507 | (image-jobs store system)) | |
508 | ('system-tests | |
509 | ;; Build Guix System tests only. | |
510 | (system-test-jobs store system | |
511 | #:source source | |
512 | #:commit commit)) | |
513 | ('tarball | |
514 | ;; Build Guix tarball only. | |
515 | (tarball-jobs store system)) | |
61a11653 MO |
516 | (('channels . channels) |
517 | ;; Build only the packages from CHANNELS. | |
518 | (let ((all (all-packages))) | |
519 | (filter-map | |
520 | (lambda (package) | |
cbfcbb79 MO |
521 | (any (lambda (channel) |
522 | (and (member (channel-name channel) channels) | |
523 | (package->job store package system))) | |
524 | (package-channels package))) | |
61a11653 | 525 | all))) |
76bea3f8 MO |
526 | (('packages . rest) |
527 | ;; Build selected list of packages only. | |
528 | (let ((packages (map specification->package rest))) | |
529 | (map (lambda (package) | |
530 | (package-job store (job-name package) | |
531 | package system)) | |
532 | packages))) | |
533 | (('manifests . rest) | |
534 | ;; Build packages in the list of manifests. | |
535 | (let* ((manifests (arguments->manifests rest channels)) | |
536 | (packages (manifests->packages store manifests))) | |
537 | (map (lambda (package) | |
538 | (package-job store (job-name package) | |
539 | package system)) | |
540 | packages))) | |
541 | (else | |
542 | (error "unknown subset" subset)))) | |
543 | systems))) |