diff --git a/core/src/magic.sld b/core/src/magic.sld index d9d264b..0bb0fec 100644 --- a/core/src/magic.sld +++ b/core/src/magic.sld @@ -21,7 +21,7 @@ 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-realised store-path-open - + zilch-magic-counters) (begin @@ -84,13 +84,13 @@ ;; If set to `#f`, `store-path-for-ca-drv*` will not generate ;; content-addressed derivations. (define *use-ca* (make-parameter #t)) - + ;; A vector of counters, counting the amount of derivations made, built, and IFD'd. (define zilch-magic-counters (vector 0 0 0)) - + (define (increment-counter 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. ;; if `output` is `""`, `drv` is the store path to a source file. (define-record-type @@ -99,7 +99,7 @@ (drv store-path-drv) (output store-path-output) (written store-path-written set-store-path-written!)) - + (define-record-printer ( rt out) (if (eqv? (store-path-output rt) "") (fprintf out "#" (store-path-path rt)) @@ -108,13 +108,13 @@ ;; Returns the store path for the output associated with this ``. (define (store-path-path 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. (define (store-path-materialize path) (unless (store-path-written path) (write-drv-to-daemon (store-path-drv path)) (set-store-path-written! path #t))) - + ;; Returns the output path of this store path; fetching it from the daemon if ;; the derivation is content-addressed. (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 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))) - + ;; 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) (if (*use-ca*) (store-path-for-ca-drv name platform builder env outputs)