summaryrefslogtreecommitdiff
path: root/cli/tools/check.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-05-29 14:38:18 -0400
committerGitHub <noreply@github.com>2024-05-29 18:38:18 +0000
commit94f040ac2867706d261e2fe1ec8bc2c4263eb6ab (patch)
tree5eaed4d41efd8d25da839bc29b8d32554e1a0fca /cli/tools/check.rs
parentfada25b0dd593efee496dabb48ed9cb7a9cb6647 (diff)
fix: bump cache sqlite dbs to v2 for WAL journal mode change (#24030)
In https://github.com/denoland/deno/pull/23955 we changed the sqlite db journal mode to WAL. This causes issues when someone is running an old version of Deno using TRUNCATE and a new version because the two fight against each other.
Diffstat (limited to 'cli/tools/check.rs')
-rw-r--r--cli/tools/check.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/cli/tools/check.rs b/cli/tools/check.rs
index c154ada7a..6eb7a071c 100644
--- a/cli/tools/check.rs
+++ b/cli/tools/check.rs
@@ -19,6 +19,7 @@ use crate::args::TsConfig;
use crate::args::TsConfigType;
use crate::args::TsTypeLib;
use crate::args::TypeCheckMode;
+use crate::cache::CacheDBHash;
use crate::cache::Caches;
use crate::cache::FastInsecureHasher;
use crate::cache::TypeCheckCache;
@@ -28,7 +29,6 @@ use crate::npm::CliNpmResolver;
use crate::tsc;
use crate::tsc::Diagnostics;
use crate::util::path::to_percent_decoded_str;
-use crate::version;
/// Options for performing a check of a module graph. Note that the decision to
/// emit or not is determined by the `ts_config` settings.
@@ -174,9 +174,8 @@ impl TypeChecker {
// to make tsc build info work, we need to consistently hash modules, so that
// tsc can better determine if an emit is still valid or not, so we provide
// that data here.
- let hash_data = FastInsecureHasher::new()
+ let hash_data = FastInsecureHasher::new_deno_versioned()
.write(&ts_config.as_bytes())
- .write_str(version::deno())
.finish();
// add fast check to the graph before getting the roots
@@ -246,7 +245,7 @@ impl TypeChecker {
}
enum CheckHashResult {
- Hash(u64),
+ Hash(CacheDBHash),
NoFiles,
}
@@ -258,7 +257,7 @@ fn get_check_hash(
type_check_mode: TypeCheckMode,
ts_config: &TsConfig,
) -> CheckHashResult {
- let mut hasher = FastInsecureHasher::new();
+ let mut hasher = FastInsecureHasher::new_deno_versioned();
hasher.write_u8(match type_check_mode {
TypeCheckMode::All => 0,
TypeCheckMode::Local => 1,
@@ -340,7 +339,7 @@ fn get_check_hash(
// no files to type check
CheckHashResult::NoFiles
} else {
- CheckHashResult::Hash(hasher.finish())
+ CheckHashResult::Hash(CacheDBHash::new(hasher.finish()))
}
}