diff --git a/lang/ninja/src/nixpkgs.sld b/lang/ninja/src/nixpkgs.sld index 1c2510f..7c8fe92 100644 --- a/lang/ninja/src/nixpkgs.sld +++ b/lang/ninja/src/nixpkgs.sld @@ -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?