From 45fad6a622700bac0b656a8500529bc4f41aed86 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 21 Nov 2024 18:16:40 -0500 Subject: [PATCH] chore(compile): log code cache file path (#26977) Ref #26976 --- cli/standalone/code_cache.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cli/standalone/code_cache.rs b/cli/standalone/code_cache.rs index 25b490544c..9580b9b44e 100644 --- a/cli/standalone/code_cache.rs +++ b/cli/standalone/code_cache.rs @@ -42,7 +42,11 @@ impl DenoCompileCodeCache { // attempt to deserialize the cache data match deserialize(&file_path, cache_key) { Ok(data) => { - log::debug!("Loaded {} code cache entries", data.len()); + log::debug!( + "Loaded {} code cache entries from {}", + data.len(), + file_path.display() + ); Self { strategy: CodeCacheStrategy::SubsequentRun( SubsequentRunCodeCacheStrategy { @@ -53,7 +57,11 @@ impl DenoCompileCodeCache { } } Err(err) => { - log::debug!("Failed to deserialize code cache: {:#}", err); + log::debug!( + "Failed to deserialize code cache from {}: {:#}", + file_path.display(), + err + ); Self { strategy: CodeCacheStrategy::FirstRun(FirstRunCodeCacheStrategy { cache_key, @@ -186,6 +194,7 @@ impl FirstRunCodeCacheStrategy { Ok(()) => { if let Err(err) = std::fs::rename(&temp_file, &self.file_path) { log::debug!("Failed to rename code cache: {}", err); + let _ = std::fs::remove_file(&temp_file); } else { log::debug!("Serialized {} code cache entries", count); }