(zilch lang ninja build): use more descriptive drv names

If the description isn't set, it will use the command to execute instead.

Change-Id: I6a6a6964105e2ad7532a601a8d7509bddea845ba
This commit is contained in:
puck 2025-05-11 22:21:07 +00:00
parent 85895d2e2a
commit 5d4fb382a8

View file

@ -59,7 +59,7 @@
(define (make-valid-store-path-string str)
(if (string=? "" str)
"zilch-ninja"
(string-map (lambda (c) (if (is-valid-store-path-char c) c #\-)) (if (> (string-length str) 211) (string-copy str 0 211) str))))
(string-map (lambda (c) (if (is-valid-store-path-char c) c #\-)) (if (> (string-length str) 128) (string-copy str 0 128) str))))
;; Returns a derivation that runs the command for this edge,
;; inside a Nix derivation with the correct inputs.
@ -219,7 +219,7 @@
(define outpath
(cdar
(store-path-for-ca-drv*
(make-valid-store-path-string (build-rule-description resolved))
(make-valid-store-path-string (if (string=? (build-rule-description resolved) "") (build-rule-command resolved) (build-rule-description resolved)))
"x86_64-linux"
'("/bin/sh" "-c" "exec /bin/sh $ZILCH_CMDPath")
`(("ZILCH_CMD" . ,command) ("passAsFile" . "ZILCH_CMD") . ,(ninja-build-config-environment (build-env-config env)))