Allow specifying a limit to inferior memory usage

To help manage the inferiors that use gigabytes of memory while computing
derivations.
This commit is contained in:
Christopher Baines 2025-06-26 20:47:43 +02:00
parent f9770b8d59
commit 7c0779519b
5 changed files with 138 additions and 131 deletions

View file

@ -52,6 +52,12 @@
(string->number arg)
(alist-delete 'parallelism
result))))
(option '("inferior-memory-limit") #t #f
(lambda (opt name arg result)
(alist-cons 'inferior-memory-limit
(string->number arg)
(alist-delete 'inferior-memory-limit
result))))
(option '("inferior-set-environment-variable") #t #f
(lambda (opt name arg result)
(alist-cons 'inferior-environment-variable
@ -111,6 +117,7 @@
opts)
#:ignore-systems (assq-ref opts 'ignore-systems)
#:ignore-targets (assq-ref opts 'ignore-targets)
#:inferior-memory-limit (assq-ref opts 'inferior-memory-limit)
#:parallelism (assq-ref opts 'parallelism)))
#:unwind? #t))
#:hz 0