From 3afa3db4d394b0e63e63ad4e09645f74eea39c4a Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 28 Aug 2024 19:47:15 -0400 Subject: [PATCH] fix: delete old Deno 1.x headers file when loading cache (#25283) --- Cargo.lock | 8 ++++---- Cargo.toml | 4 ++-- cli/cache/mod.rs | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fd92e5c91b..1df11f8b4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1347,9 +1347,9 @@ dependencies = [ [[package]] name = "deno_cache_dir" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "405790fa1fa5f05c2e7dca817f820dc1c950ea846f47212ed6d670a3023cb4fe" +checksum = "6df43311cb7703fa3242c282823a850e4c8d0c06b9527d8209b55bd695452ea5" dependencies = [ "deno_media_type", "indexmap", @@ -2010,9 +2010,9 @@ dependencies = [ [[package]] name = "deno_semver" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eef522937758930b9d6897631fa94bc69bcbbe78613c939ab2054ca96191afbd" +checksum = "6657fecb9ac6a7a71f552c95e8cc492466a75f5660224577e2226bcf30db9768" dependencies = [ "monch", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index c623d42289..ed67c14d7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,7 @@ deno_lockfile = "=0.23.0" deno_media_type = { version = "0.1.4", features = ["module_specifier"] } deno_permissions = { version = "0.26.0", path = "./runtime/permissions" } deno_runtime = { version = "0.175.0", path = "./runtime" } -deno_semver = "=0.5.12" +deno_semver = "=0.5.13" deno_terminal = "0.2.0" napi_sym = { version = "0.96.0", path = "./cli/napi/sym" } test_util = { package = "test_server", path = "./tests/util/server" } @@ -103,7 +103,7 @@ chrono = { version = "0.4", default-features = false, features = ["std", "serde" console_static_text = "=0.8.1" data-encoding = "2.3.3" data-url = "=0.3.0" -deno_cache_dir = "=0.11.0" +deno_cache_dir = "=0.11.1" deno_package_json = { version = "=0.1.1", default-features = false } dlopen2 = "0.6.1" ecb = "=0.1.2" diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs index cc183530d8..4500e3a4ac 100644 --- a/cli/cache/mod.rs +++ b/cli/cache/mod.rs @@ -74,6 +74,10 @@ impl deno_cache_dir::DenoCacheEnv for RealDenoCacheEnv { atomic_write_file_with_retries(path, bytes, CACHE_PERM) } + fn remove_file(&self, path: &Path) -> std::io::Result<()> { + std::fs::remove_file(path) + } + fn modified(&self, path: &Path) -> std::io::Result> { match std::fs::metadata(path) { Ok(metadata) => Ok(Some(