aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-06-24 15:17:52 +0100
committerChristopher Baines <mail@cbaines.net>2024-06-24 23:02:14 +0100
commit31bd2156f72dcd9fbdecdd5210f218a93a8382ec (patch)
treed6698666afd58f8d4808faee07369ed957667d38 /scripts
parentd7103eccc9c75ca3e7dcf67a72002276094b8fd4 (diff)
downloaddata-service-31bd2156f72dcd9fbdecdd5210f218a93a8382ec.tar
data-service-31bd2156f72dcd9fbdecdd5210f218a93a8382ec.tar.gz
Support setting environment variables in the inferior
When processing jobs, this is mostly to allow setting GUIX_DOWNLOAD_METHODS.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/guix-data-service-process-job.in14
-rw-r--r--scripts/guix-data-service-process-jobs.in13
2 files changed, 26 insertions, 1 deletions
diff --git a/scripts/guix-data-service-process-job.in b/scripts/guix-data-service-process-job.in
index df6142e..bb2f04a 100644
--- a/scripts/guix-data-service-process-job.in
+++ b/scripts/guix-data-service-process-job.in
@@ -51,7 +51,12 @@
(alist-cons 'parallelism
(string->number arg)
(alist-delete 'parallelism
- result))))))
+ result))))
+ (option '("inferior-set-environment-variable") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'inferior-environment-variable
+ (string-split arg #\=)
+ result)))))
(define %default-options
'((parallelism . 1)))
@@ -79,6 +84,13 @@
(process-load-new-guix-revision-job
job
#:skip-system-tests? (assq-ref opts 'skip-system-tests)
+ #:extra-inferior-environment-variables
+ (filter-map
+ (match-lambda
+ (('inferior-environment-variable key val)
+ (cons key val))
+ (_ #f))
+ opts)
#:parallelism (assq-ref opts 'parallelism)))
#:hz 0
#:parallelism 1)))))
diff --git a/scripts/guix-data-service-process-jobs.in b/scripts/guix-data-service-process-jobs.in
index ae1542c..cbe92f2 100644
--- a/scripts/guix-data-service-process-jobs.in
+++ b/scripts/guix-data-service-process-jobs.in
@@ -24,6 +24,7 @@
(use-modules (srfi srfi-1)
(srfi srfi-37)
+ (ice-9 match)
(guix-data-service database)
(guix-data-service jobs))
@@ -49,6 +50,11 @@
(lambda (opt name arg result)
(alist-cons 'per-job-parallelism
(string->number arg)
+ result)))
+ (option '("inferior-set-environment-variable") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'inferior-environment-variable
+ (string-split arg #\=)
result)))))
(define %default-options
@@ -95,6 +101,13 @@
(* 2 (assq-ref opts 'max-processes)))
#:skip-system-tests?
(assq-ref opts 'skip-system-tests)
+ #:extra-inferior-environment-variables
+ (filter-map
+ (match-lambda
+ (('inferior-environment-variable key val)
+ (cons key val))
+ (_ #f))
+ opts)
#:per-job-parallelism
(assq-ref opts 'per-job-parallelism)))
(lambda _