From 39cfc2ed5474e919f2b4f16f472f10fce00248c6 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 12 Jan 2022 15:37:32 -0800 Subject: [PATCH] in cache key, treat environment variables as case-sesnsitive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cache is supposed to take note of the `POLLEN` environment variable, but due to the spurious `string-downcase` here, was instead looking at `pollen`, which is a different key on case-sensitive systems. Windows environment variables are not case-sensitive, but it seems Racket’s `getenv` function will handle the case conversion as needed. --- pollen/private/cache-utils.rkt | 2 +- pollen/private/ts.rktd | 2 +- pollen/scribblings/cache.scrbl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pollen/private/cache-utils.rkt b/pollen/private/cache-utils.rkt index 2c3ac3b..74213e4 100644 --- a/pollen/private/cache-utils.rkt +++ b/pollen/private/cache-utils.rkt @@ -36,7 +36,7 @@ ;; user-designated files to track (map ->string (setup:cache-watchlist source-path))))) (define env-rec (for/list ([env-name (in-list (cons default-env-name (sort (setup:envvar-watchlist source-path) bytesstring env-name))) + (cons env-name (match (getenv (->string env-name)) [#false #false] [str (string-downcase (->string str))])))) (define poly-flag (and (has-inner-poly-ext? source-path) (current-poly-target))) diff --git a/pollen/private/ts.rktd b/pollen/private/ts.rktd index eba5ab6..4fa9734 100644 --- a/pollen/private/ts.rktd +++ b/pollen/private/ts.rktd @@ -1 +1 @@ -1637865036 +1642030652 diff --git a/pollen/scribblings/cache.scrbl b/pollen/scribblings/cache.scrbl index 0dfbef8..8b0c609 100644 --- a/pollen/scribblings/cache.scrbl +++ b/pollen/scribblings/cache.scrbl @@ -43,7 +43,7 @@ Be warned that this will make your rendering much slower. But you will be guaran @section{Scope of dependency tracking} -The compile cache tracks the modification date of the source file, the current setting of @secref["The_POLLEN_environment_variable"], and the modification dates of the template and @filepath{pollen.rkt} (if they exist). For @tt{poly} source files, it also tracks the @racket[current-poly-target]. It also tracks any files you've listed in the optional setup value @racket[setup:cache-watchlist]. +The compile cache tracks the modification date of the source file, the current setting of @secref["The_POLLEN_environment_variable"], and the modification dates of the template and @filepath{pollen.rkt} (if they exist). For @tt{poly} source files, it also tracks the @racket[current-poly-target]. It also tracks files you've listed in the optional setup value @racket[setup:cache-watchlist] and environment variables listed in the optional setup value @racket[setup:envvar-watchlist]. It does not, however, track every possible dependency. So in a complex project, it's possible to create deep dependencies that aren't noticed by the cache. In particular, Pollen does not track pagetree files as dependencies of other source files. Thus, if you change a pagetree, you'll ordinarily need to use @exec{raco pollen reset} to clear the caches.