(zilch magic): add nix-build build step

This commit is contained in:
puck 2025-03-20 17:46:22 +00:00
parent 3e3b9a8bb9
commit e65143d89e
2 changed files with 22 additions and 0 deletions

View file

@ -20,6 +20,8 @@
trace
json
(callPackage ../planner {})
libsodium # TODO(puck): don't propagate this
];
}

View file

@ -5,6 +5,7 @@
(import
(scheme base) (scheme file)
(zilch lib hash) (zilch nix daemon) (zilch nix drv) (zilch nix path)
(zilch planner step)
(zilch zexpr)
(srfi 128) (srfi 132) (srfi 146) (srfi 152)
(chicken base) (chicken format) socket)
@ -250,6 +251,25 @@
(daemon-wop-build-paths (*daemon*) (list->vector to-build)))
val)
(register-build-step '((zilch core magic) build) #t
(lambda items
(printf "received build info: ~S\n" items)
(define all-paths '())
(for-each
(lambda (item)
(define outputs (list-ref item 1))
(define drv-path (list-ref item 2))
(set! all-paths (append (map (lambda (o) (string-append drv-path "!" o)) outputs) all-paths)))
items)
(daemon-wop-build-paths (*daemon*) (list->vector all-paths))
(define output '())
(for-each
(lambda (item)
(define output-map (daemon-wop-query-derivation-output-map (*daemon*) (list-ref item 2)))
(set! output (cons (cons (car item) output-map) output)))
items)
output))
;; Ensures the `<store-path>` exists, then opens an input port to allow reading from it.
(define (store-path-open path)
(increment-counter 2)