(zilch lang ninja nixpkgs): don't choke on non-UTF-8 files
Change-Id: I7d3472c0492104574cc4b7264ab1ceaf6a6a6964
This commit is contained in:
parent
99bb57a4ed
commit
48e8cd9455
1 changed files with 4 additions and 4 deletions
|
|
@ -377,6 +377,8 @@
|
|||
rewrites))
|
||||
(make-finalized-drv store-paths export-depfile secondary-roots conf))
|
||||
|
||||
(define marker-header (string->utf8 "ZILCH MARKER FILE ->"))
|
||||
|
||||
;; Build the derivation, but with stubbed out header and .so files.
|
||||
;; This is used to determine the dataflow, to make cross-project incremental
|
||||
;; builds work.
|
||||
|
|
@ -469,8 +471,8 @@
|
|||
(define (get-file-marker fptr)
|
||||
(call-with-port (store-path-open fptr)
|
||||
(lambda (p)
|
||||
(define header (read-string 20 p))
|
||||
(and (string=? header "ZILCH MARKER FILE ->")
|
||||
(define header (read-bytevector 20 p))
|
||||
(and (equal? header marker-header)
|
||||
(let ((str (read-string 99999 p)))
|
||||
(string-copy str 0 (- (string-length str) 1)))))))
|
||||
(define output (mapping (make-default-comparator)))
|
||||
|
|
@ -489,5 +491,3 @@
|
|||
(vfs-contents vfs)))
|
||||
(for-each process-output patched-drv)
|
||||
output)))
|
||||
|
||||
; TODO(puck): for each output, do the necessary dance of figuring out where it came from. read first N bytes, compare, then do the thing. output a big alist and do the dataflow dance?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue