From 273645805a18afee14574c945fa916d2b1b12692 Mon Sep 17 00:00:00 2001 From: milner Date: Wed, 17 Aug 2022 19:24:25 +0000 Subject: [PATCH] fix(watch): drop the digest memo between rounds --- bin/meowc.ml | 1 + lib/cache.ml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/bin/meowc.ml b/bin/meowc.ml index 16c625d..5d2a6e2 100644 --- a/bin/meowc.ml +++ b/bin/meowc.ml @@ -535,6 +535,7 @@ let cmd_compdb () = let cmd_watch names = let round () = + Cache.reset (); let p = configure () in with_config_header p; let t0 = Unix.gettimeofday () in diff --git a/lib/cache.ml b/lib/cache.ml index db70a0a..5299a97 100644 --- a/lib/cache.ml +++ b/lib/cache.ml @@ -36,6 +36,10 @@ let digest_file p = let forget p = Hashtbl.remove digests p +(* The memo saves re-hashing a header that half the project includes, so it is + only ever valid for one build. A watch loop runs many in one process. *) +let reset () = Hashtbl.reset digests + let key ~cmd ~inputs = let b = Buffer.create 256 in Buffer.add_string b cmd;