(zilch magic): whitespace fixes

This commit is contained in:
puck 2025-05-11 22:21:07 +00:00
parent ec41674598
commit 7e8e504f89

View file

@ -21,7 +21,7 @@
store-path-for-text store-path-for-fod store-path-for-drv store-path-for-text store-path-for-fod store-path-for-drv
store-path-for-impure-drv store-path-for-ca-drv store-path-for-ca-drv* store-path-for-impure-drv store-path-for-ca-drv store-path-for-ca-drv*
store-path-realised store-path-open store-path-realised store-path-open
zilch-magic-counters) zilch-magic-counters)
(begin (begin
@ -84,13 +84,13 @@
;; If set to `#f`, `store-path-for-ca-drv*` will not generate ;; If set to `#f`, `store-path-for-ca-drv*` will not generate
;; content-addressed derivations. ;; content-addressed derivations.
(define *use-ca* (make-parameter #t)) (define *use-ca* (make-parameter #t))
;; A vector of counters, counting the amount of derivations made, built, and IFD'd. ;; A vector of counters, counting the amount of derivations made, built, and IFD'd.
(define zilch-magic-counters (vector 0 0 0)) (define zilch-magic-counters (vector 0 0 0))
(define (increment-counter index) (define (increment-counter index)
(vector-set! zilch-magic-counters index (+ 1 (vector-ref zilch-magic-counters index)))) (vector-set! zilch-magic-counters index (+ 1 (vector-ref zilch-magic-counters index))))
;; Represents a reference to an output path of a derivation, or a source file. ;; Represents a reference to an output path of a derivation, or a source file.
;; if `output` is `""`, `drv` is the store path to a source file. ;; if `output` is `""`, `drv` is the store path to a source file.
(define-record-type <store-path> (define-record-type <store-path>
@ -99,7 +99,7 @@
(drv store-path-drv) (drv store-path-drv)
(output store-path-output) (output store-path-output)
(written store-path-written set-store-path-written!)) (written store-path-written set-store-path-written!))
(define-record-printer (<store-path> rt out) (define-record-printer (<store-path> rt out)
(if (eqv? (store-path-output rt) "") (if (eqv? (store-path-output rt) "")
(fprintf out "#<store path ~A>" (store-path-path rt)) (fprintf out "#<store path ~A>" (store-path-path rt))
@ -108,13 +108,13 @@
;; Returns the store path for the output associated with this `<store-path>`. ;; Returns the store path for the output associated with this `<store-path>`.
(define (store-path-path path) (define (store-path-path path)
(derivation-output-path (cdr (assoc (store-path-output path) (derivation-outputs (store-path-drv path)))))) (derivation-output-path (cdr (assoc (store-path-output path) (derivation-outputs (store-path-drv path))))))
;; Makes sure the derivation referenced by this store path exists in the daemon. ;; Makes sure the derivation referenced by this store path exists in the daemon.
(define (store-path-materialize path) (define (store-path-materialize path)
(unless (store-path-written path) (unless (store-path-written path)
(write-drv-to-daemon (store-path-drv path)) (write-drv-to-daemon (store-path-drv path))
(set-store-path-written! path #t))) (set-store-path-written! path #t)))
;; Returns the output path of this store path; fetching it from the daemon if ;; Returns the output path of this store path; fetching it from the daemon if
;; the derivation is content-addressed. ;; the derivation is content-addressed.
(define (store-path-realisation path) (define (store-path-realisation path)
@ -192,7 +192,7 @@
(define input-srcs (merge-srcs (zexp-evaluation-srcs collected-env) (zexp-evaluation-srcs collected-builder))) (define input-srcs (merge-srcs (zexp-evaluation-srcs collected-env) (zexp-evaluation-srcs collected-builder)))
(define drv (make-ca-derivation name platform input-drvs input-srcs (zexp-evaluation-value collected-builder) (zexp-evaluation-value collected-env) outputs)) (define drv (make-ca-derivation name platform input-drvs input-srcs (zexp-evaluation-value collected-builder) (zexp-evaluation-value collected-env) outputs))
(map (lambda (l) (cons (car l) (make-store-path drv (car l) #f))) (derivation-outputs drv))) (map (lambda (l) (cons (car l) (make-store-path drv (car l) #f))) (derivation-outputs drv)))
;; Calls either `store-path-for-ca-drv` or `store-path-for-drv` depending on `*use-ca*`. ;; Calls either `store-path-for-ca-drv` or `store-path-for-drv` depending on `*use-ca*`.
(define (store-path-for-ca-drv* name platform builder env outputs) (define (store-path-for-ca-drv* name platform builder env outputs)
(if (*use-ca*) (store-path-for-ca-drv name platform builder env outputs) (if (*use-ca*) (store-path-for-ca-drv name platform builder env outputs)