From 4ebfc3dcecea7ff6ee424b17eae6bb443cb30755 Mon Sep 17 00:00:00 2001 From: forhappy Date: Wed, 14 Oct 2026 21:13:56 -0700 Subject: [PATCH] fix(sqlite): align Crab with fixed WAL runtime Select the minimal Cellule backport and bundled SQLite 3.51.3. Preserve checked unsigned bindings and propagate inspection hook installation errors before SQL. Keep the unrelated Cellule 0.2 storage migration out of this dependency correction. --- Cargo.lock | 49 ++++++++++++++++++++-------- Cargo.toml | 12 +++---- crates/crab-cache/REFERENCE.md | 16 ++++++--- crates/crab-cache/src/shard_hints.rs | 10 +++--- 4 files changed, 59 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad69dadea..aa7fddfa3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1527,7 +1527,7 @@ dependencies = [ [[package]] name = "cellule-app" version = "0.1.0" -source = "git+https://github.com/crabbuild/cellule?rev=6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6#6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6" +source = "git+https://github.com/crabbuild/cellule?rev=25809dc7a3acc37411776d79f526512088e466c3#25809dc7a3acc37411776d79f526512088e466c3" dependencies = [ "blake3", "cellule-runtime", @@ -1536,7 +1536,7 @@ dependencies = [ [[package]] name = "cellule-host" version = "0.1.0" -source = "git+https://github.com/crabbuild/cellule?rev=6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6#6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6" +source = "git+https://github.com/crabbuild/cellule?rev=25809dc7a3acc37411776d79f526512088e466c3#25809dc7a3acc37411776d79f526512088e466c3" dependencies = [ "cellule-app", "cellule-runtime", @@ -1550,7 +1550,7 @@ dependencies = [ [[package]] name = "cellule-ltx" version = "0.1.0" -source = "git+https://github.com/crabbuild/cellule?rev=6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6#6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6" +source = "git+https://github.com/crabbuild/cellule?rev=25809dc7a3acc37411776d79f526512088e466c3#25809dc7a3acc37411776d79f526512088e466c3" dependencies = [ "async-trait", "blake3", @@ -1572,7 +1572,7 @@ dependencies = [ [[package]] name = "cellule-runtime" version = "0.1.0" -source = "git+https://github.com/crabbuild/cellule?rev=6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6#6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6" +source = "git+https://github.com/crabbuild/cellule?rev=25809dc7a3acc37411776d79f526512088e466c3#25809dc7a3acc37411776d79f526512088e466c3" dependencies = [ "async-trait", "blake3", @@ -1600,7 +1600,7 @@ dependencies = [ [[package]] name = "cellule-store" version = "0.1.0" -source = "git+https://github.com/crabbuild/cellule?rev=6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6#6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6" +source = "git+https://github.com/crabbuild/cellule?rev=25809dc7a3acc37411776d79f526512088e466c3#25809dc7a3acc37411776d79f526512088e466c3" dependencies = [ "async-trait", "blake3", @@ -1623,7 +1623,7 @@ dependencies = [ [[package]] name = "cellule-types" version = "0.1.0" -source = "git+https://github.com/crabbuild/cellule?rev=6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6#6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6" +source = "git+https://github.com/crabbuild/cellule?rev=25809dc7a3acc37411776d79f526512088e466c3#25809dc7a3acc37411776d79f526512088e466c3" dependencies = [ "schemars 0.8.22", "serde", @@ -5111,11 +5111,11 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +checksum = "824e001ac4f3012dd16a264bec811403a67ca9deb6c102fc5049b32c4574b35f" dependencies = [ - "hashbrown 0.15.5", + "hashbrown 0.16.1", ] [[package]] @@ -6079,9 +6079,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.32.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb8270bb4060bd76c6e96f20c52d80620f1d82a3470885694e41e0f81ef6fe7" +checksum = "b1f111c8c41e7c61a49cd34e44c7619462967221a6443b0ec299e0ac30cfb9b1" dependencies = [ "cc", "pkg-config", @@ -8157,11 +8157,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rsqlite-vfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c" +dependencies = [ + "hashbrown 0.16.1", + "thiserror 2.0.18", +] + [[package]] name = "rusqlite" -version = "0.34.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e34486da88d8e051c7c0e23c3f15fd806ea8546260aa2fec247e97242ec143" +checksum = "a0d2b0146dd9661bf67bb107c0bb2a55064d556eeb3fc314151b957f313bcd4e" dependencies = [ "bitflags 2.11.1", "fallible-iterator", @@ -8169,6 +8179,7 @@ dependencies = [ "hashlink", "libsqlite3-sys", "smallvec", + "sqlite-wasm-rs", ] [[package]] @@ -9040,6 +9051,18 @@ dependencies = [ "der", ] +[[package]] +name = "sqlite-wasm-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3efc0da82635d7e1ced0053bbbfa8c7ab9645d0bf36ceb4f7127bb85315d75" +dependencies = [ + "cc", + "js-sys", + "rsqlite-vfs", + "wasm-bindgen", +] + [[package]] name = "stable_deref_trait" version = "1.2.1" diff --git a/Cargo.toml b/Cargo.toml index d6fd34b4c..dc14e7c7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,11 +34,11 @@ repository = "https://github.com/crabbuild/crab" rust-version = "1.97" [workspace.dependencies] -cellule-runtime = { git = "https://github.com/crabbuild/cellule", rev = "6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6", default-features = false } -cellule-app = { git = "https://github.com/crabbuild/cellule", rev = "6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6", default-features = false } -cellule-host = { git = "https://github.com/crabbuild/cellule", rev = "6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6", default-features = false } -cellule-ltx = { git = "https://github.com/crabbuild/cellule", rev = "6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6", default-features = false } -cellule-store = { git = "https://github.com/crabbuild/cellule", rev = "6ac8a03ff784e2cd6ac001d75c84e3890c0ba4c6", default-features = false } +cellule-runtime = { git = "https://github.com/crabbuild/cellule", rev = "25809dc7a3acc37411776d79f526512088e466c3", default-features = false } +cellule-app = { git = "https://github.com/crabbuild/cellule", rev = "25809dc7a3acc37411776d79f526512088e466c3", default-features = false } +cellule-host = { git = "https://github.com/crabbuild/cellule", rev = "25809dc7a3acc37411776d79f526512088e466c3", default-features = false } +cellule-ltx = { git = "https://github.com/crabbuild/cellule", rev = "25809dc7a3acc37411776d79f526512088e466c3", default-features = false } +cellule-store = { git = "https://github.com/crabbuild/cellule", rev = "25809dc7a3acc37411776d79f526512088e466c3", default-features = false } crab-auth = { version = "=0.1.0", path = "crates/crab-auth", default-features = false } crab-auth-server = { version = "=1.2.4", path = "crates/crab-auth-server", default-features = false } crab-auth-store = { version = "=0.1.0", path = "crates/crab-auth-store", default-features = false } @@ -136,7 +136,7 @@ globset = "0.4" object_store = { version = "0.14.1", default-features = false } prost = "0.13" reqwest = { version = "0.12", default-features = false } -rusqlite = { version = "0.34", features = ["bundled"] } +rusqlite = { version = "0.39", features = ["bundled", "fallible_uint"] } schemars = "0.8" serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/crates/crab-cache/REFERENCE.md b/crates/crab-cache/REFERENCE.md index fc0e4edcd..d2a35f641 100644 --- a/crates/crab-cache/REFERENCE.md +++ b/crates/crab-cache/REFERENCE.md @@ -332,8 +332,14 @@ supply its supposedly corrupted header; its original assertions remain. Strict combined-feature all-target Clippy also passes. Native-platform coverage and the failed 1,024-file push rerun remain required. -The pinned SQLite 3.49.1 also falls in the affected range of the upstream -[WAL-reset race](https://www.sqlite.org/wal.html#walreset). A matched Crab and -Cellule dependency upgrade to a fixed SQLite release is a prerequisite for -release qualification; these focused tests do not establish immunity to that -race. No dependency or lockfile change is included in this optimization. +The workspace selects SQLite 3.51.3 through rusqlite 0.39 and the matched +[Cellule backport](https://github.com/crabbuild/cellule/pull/78). The earlier +SQLite 3.49.1 was affected by the upstream +[WAL-reset race](https://www.sqlite.org/wal.html#walreset). This dependency +upgrade preserves unsigned conversion checks and rejects progress-hook +installation failures before shard-hint inspection. The checkpoint policy +and dependency change are separate reviewable commits. Private-VFS, cache, +affected-consumer and native workflow qualification must run against this +linked SQLite version before release. The combined cache suite has been +repeated on this dependency: 309 library tests and three credential tests +pass; native workflow and affected-consumer gates remain open. diff --git a/crates/crab-cache/src/shard_hints.rs b/crates/crab-cache/src/shard_hints.rs index 5f34852dd..8553211b0 100644 --- a/crates/crab-cache/src/shard_hints.rs +++ b/crates/crab-cache/src/shard_hints.rs @@ -237,10 +237,12 @@ fn inspect_database_at_with_limits( let interrupt_cancel = cancel.clone(); // SQLite calls this between VM operations, not inside blocking VFS I/O. // Keep lock admission bounded separately; this is not a hard syscall deadline. - database.progress_handler( - progress_ops, - Some(move || interrupt_cancel.is_cancelled() || Instant::now() >= deadline), - ); + database + .progress_handler( + progress_ops, + Some(move || interrupt_cancel.is_cancelled() || Instant::now() >= deadline), + ) + .map_err(|source| inspection_error(&path, source, cancel, deadline, timeout))?; let transaction = database .transaction_with_behavior(TransactionBehavior::Deferred) .map_err(|source| inspection_error(&path, source, cancel, deadline, timeout))?;