symbols not bytes

pull/218/head
Matthew Butterick 5 years ago
parent 0051d3836f
commit 070b9655d2

@ -23,7 +23,7 @@
;; because cache validity is not sensitive to mod date of output path ;; because cache validity is not sensitive to mod date of output path
;; (in fact we would expect it to be earlier, since we want to rely on an earlier version) ;; (in fact we would expect it to be earlier, since we want to rely on an earlier version)
(define (paths->key source-path [template-path #false] [output-path #false]) (define (paths->key source-path [template-path #false] [output-path #false])
(define-values (env-watchlist path-watchlist) (partition bytes? (setup:cache-watchlist source-path))) (define-values (env-watchlist path-watchlist) (partition symbol? (setup:cache-watchlist source-path)))
(define path-strings-to-track (define path-strings-to-track
(list* source-path (list* source-path
;; if template has a source file, track that instead ;; if template has a source file, track that instead
@ -34,7 +34,7 @@
(map ->string path-watchlist)))) (map ->string path-watchlist))))
(define pollen-env (getenv default-env-name)) (define pollen-env (getenv default-env-name))
(define env-rec (for/list ([env-name (in-list (sort env-watchlist bytes<?))]) (define env-rec (for/list ([env-name (in-list (sort env-watchlist bytes<?))])
(cons env-name (environment-variables-ref (current-environment-variables) env-name)))) (cons env-name (getenv (symbol->string env-name)))))
(define poly-flag (and (has-inner-poly-ext? source-path) (current-poly-target))) (define poly-flag (and (has-inner-poly-ext? source-path) (current-poly-target)))
(define path+mod-time-pairs (define path+mod-time-pairs
(for/list ([ps (in-list path-strings-to-track)]) (for/list ([ps (in-list path-strings-to-track)])

@ -1 +1 @@
1566498507 1566498885

@ -106,7 +106,7 @@ Default separators used in decoding.
@defoverridable[compile-cache-max-size exact-positive-integer?]{Maximum size of the compile cache.} @defoverridable[compile-cache-max-size exact-positive-integer?]{Maximum size of the compile cache.}
@defoverridable[cache-watchlist (listof (or/c path? path-string? bytes?))]{List of extra things that the cache (= render cache + compile cache, collectively) watches during a project-server session, which can be files (each given as a @racket[path?] or @racket[path-string?]) and environment variables (each given as @racket[bytes?]). @defoverridable[cache-watchlist (listof (or/c path? path-string? symbol?))]{List of extra things that the cache (= render cache + compile cache, collectively) watches during a project-server session, which can be files (each given as a @racket[path?] or @racket[path-string?]) and environment variables (each given as a @racket[symbol?]).
Here's how files on the watchlist are handled. If one of the files on the watchlist changes, the cache is invalidated (just as it would be if @racket["pollen.rkt"] changed). If the cache can't find a certain file on the watchlist, no error will arise. The file will simply be ignored. Therefore, to avoid unexpected behavior, the best policy is to use complete paths (or path strings). One way to generate a complete path to a local file is with @racket[define-runtime-path]. Another way, if you're using a module that's already installed as part of a package, is with @racket[resolve-module-path]: Here's how files on the watchlist are handled. If one of the files on the watchlist changes, the cache is invalidated (just as it would be if @racket["pollen.rkt"] changed). If the cache can't find a certain file on the watchlist, no error will arise. The file will simply be ignored. Therefore, to avoid unexpected behavior, the best policy is to use complete paths (or path strings). One way to generate a complete path to a local file is with @racket[define-runtime-path]. Another way, if you're using a module that's already installed as part of a package, is with @racket[resolve-module-path]:
@ -120,7 +120,7 @@ Here's how files on the watchlist are handled. If one of the files on the watchl
(define cache-watchlist (list my-local-mod my-installed-mod))) (define cache-watchlist (list my-local-mod my-installed-mod)))
}] }]
Here's how environment variables on the watchlist are handled. By default, the cache always watches the default @racket[#"POLLEN"] environment variable, but no others. By listing other environment variables in the watchlist, Pollen will watch those too. Unlike files, environment variables don't change during a session. But separate caches will be maintained for each distinct value of an environment variable. Here's how environment variables on the watchlist are handled. By default, the cache always watches the default @racket[POLLEN] environment variable, but no others. By listing other environment variables in the watchlist, Pollen will watch those too. Unlike files, environment variables don't change during a session. But separate caches will be maintained for each distinct value of an environment variable.
@history[#:added "1.4"] @history[#:added "1.4"]
} }

Loading…
Cancel
Save