(zilch magic): Copy settings from primary daemon connections

This ensures the CA build logic won't substitute if the main daemon
link wouldn't either.

Change-Id: I3ac2fd91bc2158e750d9ace5890d47866a6a6964
This commit is contained in:
puck 2025-11-24 13:12:36 +00:00
parent 83993d7739
commit 66fa24c69d
2 changed files with 7 additions and 1 deletions

View file

@ -533,7 +533,7 @@
(cons (cons
(thread-start! (thread-start!
(make-thread (make-thread
(lambda () (define thread-conn (daemon-connect)) (call/cc (lambda (cc) (builder cc thread-conn))) (daemon-close thread-conn)) (lambda () (define thread-conn (daemon-connect)) (daemon-link-copy-settings thread-conn (*daemon*)) (call/cc (lambda (cc) (builder cc thread-conn))) (daemon-close thread-conn))
(string-append "ca-builder-" (number->string i)))) (string-append "ca-builder-" (number->string i))))
builder-threads))) builder-threads)))

View file

@ -22,6 +22,7 @@
*logger* *logger*
daemon-link-copy-settings
daemon-wop-handshake daemon-wop-set-options daemon-wop-handshake daemon-wop-set-options
daemon-wop-add-text-to-store daemon-wop-build-paths daemon-wop-add-text-to-store daemon-wop-build-paths
daemon-wop-query-derivation-output-map daemon-wop-query-derivation-output-map
@ -211,6 +212,11 @@
(daemon-read-log-events link) (daemon-read-log-events link)
(daemon-wop-set-options link)) (daemon-wop-set-options link))
;; Copy the daemon settings from `from` into `into`.
(define (daemon-link-copy-settings into from)
(define settings (daemon-link-settings from))
(daemon-wop-set-options into (daemon-link-settings-verbosity settings) (daemon-link-settings-max-build-jobs settings) (daemon-link-settings-use-substitutes settings)))
;; Sets some of the daemon's settings. ;; Sets some of the daemon's settings.
;; ;;
;; - `verbosity` is the verbosity (amount of `-v` arguments in Nix) ;; - `verbosity` is the verbosity (amount of `-v` arguments in Nix)