(zilch lang ninja): document
Change-Id: I6a6a6964dcc713504ec57f40981a601696a573af
This commit is contained in:
parent
154ba9be1c
commit
93a1ebba00
11 changed files with 329 additions and 43 deletions
|
|
@ -1,3 +1,4 @@
|
|||
;; Helpers to work with Zilch around Nixpkgs derivations.
|
||||
(define-library (zilch lang ninja nixpkgs)
|
||||
(import
|
||||
(scheme base) (chicken format) (scheme lazy)
|
||||
|
|
@ -74,7 +75,23 @@
|
|||
(set! output (string-copy output 0 32)))
|
||||
|
||||
(string-append "/nix/store/" output (string-copy base-placeholder (string-length output)) name (if (string=? output "out") "" (string-append "-" output))))
|
||||
|
||||
|
||||
;; Takes a `<ninja-build-config>` representing a Nixpkgs derivation, and
|
||||
;; preprocesses the derivation such that it can be reconstituted once Zilch
|
||||
;; has taken over the Ninja build requirements.
|
||||
;;
|
||||
;; This procedure is used internally, and shouldn't be relied upon; it
|
||||
;; encodes many specific parts that are unlikely to be useful by external
|
||||
;; parties.
|
||||
;;
|
||||
;; Returns 6 values:
|
||||
;;
|
||||
;; - The initial Nixpkgs derivation as `<derivation>`
|
||||
;; - The Nixpkgs derivation after running all phases up to and including
|
||||
;; configuration
|
||||
;; - An alist of output names to placeholder store paths
|
||||
;; - The `edge-ref`, `defaults`, and `export-depfile` values from calling
|
||||
;; `process-ninja-file`
|
||||
(define (setup-ninja-environment conf)
|
||||
(define initial-drv (ninja-build-config-environment-drv conf))
|
||||
(when (store-path? initial-drv)
|
||||
|
|
@ -125,7 +142,17 @@
|
|||
(define-values (edge-ref defaults export-depfile) (process-ninja-file ninja-file conf "build"))
|
||||
|
||||
(values initial-drv configured-drv placeholders edge-ref defaults export-depfile))
|
||||
|
||||
|
||||
;; Takes a `<ninja-build-config>` representing a Nixpkgs derivation, and
|
||||
;; build it using Zilch.
|
||||
;;
|
||||
;; Returns two values:
|
||||
;;
|
||||
;; - An alist of output name to store paths, representing the built
|
||||
;; derivation
|
||||
;; - A procedure that, when called, returns a mapping of output path to
|
||||
;; necessary inputs generated from the depfile data. This can be stored in
|
||||
;; a file for later rebuilds.
|
||||
(define (build-nixpkgs-drv-reproducibly conf)
|
||||
(define-values (initial-drv configured-drv placeholders edge-ref defaults export-depfile) (setup-ninja-environment conf))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue