|
|
@ -7,10 +7,12 @@
|
|
|
|
racket/file
|
|
|
|
racket/file
|
|
|
|
racket/path
|
|
|
|
racket/path
|
|
|
|
racket/list
|
|
|
|
racket/list
|
|
|
|
|
|
|
|
racket/port
|
|
|
|
racket/match
|
|
|
|
racket/match
|
|
|
|
sugar/coerce
|
|
|
|
sugar/coerce
|
|
|
|
sugar/test
|
|
|
|
sugar/test
|
|
|
|
racket/fasl
|
|
|
|
racket/fasl
|
|
|
|
|
|
|
|
racket/serialize
|
|
|
|
compiler/cm)
|
|
|
|
compiler/cm)
|
|
|
|
(provide (all-defined-out))
|
|
|
|
(provide (all-defined-out))
|
|
|
|
|
|
|
|
|
|
|
@ -119,9 +121,13 @@
|
|
|
|
(define dest-file (build-path cache-dir (format "~a.rktd" dest-path-filename)))
|
|
|
|
(define dest-file (build-path cache-dir (format "~a.rktd" dest-path-filename)))
|
|
|
|
(define (generate-dest-file)
|
|
|
|
(define (generate-dest-file)
|
|
|
|
(message-debug (format "cache miss for ~a" dest-file))
|
|
|
|
(message-debug (format "cache miss for ~a" dest-file))
|
|
|
|
(with-output-to-file dest-file
|
|
|
|
#;(with-output-to-file dest-file
|
|
|
|
(λ () (s-exp->fasl (path-hash-thunk) (current-output-port)))
|
|
|
|
(λ ()
|
|
|
|
#:exists 'replace))
|
|
|
|
(define op (open-output-bytes))
|
|
|
|
|
|
|
|
(s-exp->fasl (path-hash-thunk) op)
|
|
|
|
|
|
|
|
(write-bytes (get-output-bytes op)))
|
|
|
|
|
|
|
|
#:exists 'replace)
|
|
|
|
|
|
|
|
(write-to-file (serialize (path-hash-thunk)) dest-file #:exists 'replace))
|
|
|
|
|
|
|
|
|
|
|
|
;; `cache-file` looks for a file in private-cache-dir previously cached with key
|
|
|
|
;; `cache-file` looks for a file in private-cache-dir previously cached with key
|
|
|
|
;; (which in this case carries modification dates and POLLEN env).
|
|
|
|
;; (which in this case carries modification dates and POLLEN env).
|
|
|
@ -144,5 +150,6 @@
|
|
|
|
[(or "cache attempt failed: could not acquire exclusive lock"
|
|
|
|
[(or "cache attempt failed: could not acquire exclusive lock"
|
|
|
|
"cache attempt failed: could not acquire shared lock") (void)]
|
|
|
|
"cache attempt failed: could not acquire shared lock") (void)]
|
|
|
|
[_ (log-pollen-error str)])))
|
|
|
|
[_ (log-pollen-error str)])))
|
|
|
|
(with-input-from-file dest-file
|
|
|
|
#;(with-input-from-file dest-file
|
|
|
|
(λ () (fasl->s-exp (current-input-port)))))
|
|
|
|
(λ () (fasl->s-exp (port->bytes))))
|
|
|
|
|
|
|
|
(deserialize (file->value dest-file)))
|
|
|
|