(zilch lang ninja build): add "may fail" to edge-ref
Change-Id: I6a6a69642d0f1daf57c0dee4a0291595f1c13cb2
This commit is contained in:
parent
5485b0f4ce
commit
a57b991013
1 changed files with 6 additions and 3 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
(define-library (zilch lang ninja build)
|
(define-library (zilch lang ninja build)
|
||||||
(import
|
(import
|
||||||
(scheme base) (scheme lazy) (scheme file)
|
(scheme base) (scheme lazy) (scheme file)
|
||||||
|
(scheme case-lambda)
|
||||||
(zilch file) (zilch magic) (scheme char)
|
(zilch file) (zilch magic) (scheme char)
|
||||||
(zilch nix drv) (zilch nix path)
|
(zilch nix drv) (zilch nix path)
|
||||||
(zilch nixpkgs) (zilch zexpr) (zilch vfs)
|
(zilch nixpkgs) (zilch zexpr) (zilch vfs)
|
||||||
|
|
@ -536,8 +537,10 @@
|
||||||
(set-build-env-vfs! env (vfs-to-store (make-vfs filtered-vfs)))
|
(set-build-env-vfs! env (vfs-to-store (make-vfs filtered-vfs)))
|
||||||
|
|
||||||
(define edge-ref
|
(define edge-ref
|
||||||
(lambda (path)
|
(case-lambda
|
||||||
(define edge (mapping-ref edges path (lambda () (mapping-ref edges (normalize-path path) (lambda () (error "Target doesn't exist" path))))))
|
((path) (edge-ref path #f))
|
||||||
(cons (if (promise? (car edge)) (force (car edge)) (car edge)) (force (cdr edge)))))
|
((path may-fail)
|
||||||
|
(define edge (mapping-ref edges path (lambda () (mapping-ref edges (normalize-path path) (lambda () (if may-fail #f (error "Target doesn't exist" path)))))))
|
||||||
|
(and edge (cons (if (promise? (car edge)) (force (car edge)) (car edge)) (force (cdr edge)))))))
|
||||||
(define defaults (build-file-default-targets file))
|
(define defaults (build-file-default-targets file))
|
||||||
(values edge-ref defaults (lambda () (build-env-collected-deps env))))))
|
(values edge-ref defaults (lambda () (build-env-collected-deps env))))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue