2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2024-12-29 11:40:16 +01:00

examples: random: Create jobs with non-job dependencies.

* examples/random-manifest.scm <top level>: Add dependency on non-job
derivation.
This commit is contained in:
Ludovic Courtès 2024-06-05 17:53:58 +02:00
parent c326f6ccbb
commit fccb8694e6
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1,5 +1,5 @@
;;; random-manifest.scm -- Return a manifest of random entries.
;;; Copyright © 2018, 2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018, 2023-2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;;
;;; This file is part of Cuirass.
@ -80,10 +80,16 @@
(if (>= i 20)
(reverse lst)
(let* ((multiple-outputs? (zero? (modulo i 5)))
(dependency (and (= 0 (modulo i 3))
(> i 0)
(list-ref lst
(random (length lst) %state))))
(dependency (cond ((and (zero? (modulo i 3))
(> i 0))
(list-ref lst
(random (length lst) %state)))
((zero? (modulo i 4))
(make-job
"entropy"
(random-computed-file
"entropy-derivation-without-a-job")))
(else #f)))
(suffix (string-append
(if multiple-outputs?
"multiple-outputs"