Skip to content

build: bump rusqlite to 0.37 for downstream SQLCipher unification (v0.7.x) - #1224

Closed
gdmaster3 wants to merge 5 commits into
lightningdevkit:release/0.7from
gdmaster3:sw/rusqlite-0.37
Closed

gdmaster3 wants to merge 5 commits into
lightningdevkit:release/0.7from
gdmaster3:sw/rusqlite-0.37

Conversation

@gdmaster3

@gdmaster3 gdmaster3 commented Nov 8, 2026 •

Copy link
Copy Markdown

Motivation

Downstream wallets that embed LDK together with SQLCipher (e.g. a mobile wallet using bundled-sqlcipher-vendored-openssl) need exactly one libsqlite3-sys in the final binary. Cargo's links = "sqlite3" rule makes that impossible unless every rusqlite in the graph resolves to the same sqlite3-sys generation, and a rusqlite 0.31 (v0.7.x) / rusqlite 0.37 (downstream pin) pair cannot co-resolve.

Full disclosure: main already loosened the requirement to >=0.31.0, <0.40.0 (Cargo.toml:109-110, from #1187), so this is not a hot-fix. It is a backport-willing maintenance contribution so the v0.7.x line can interoperate, together with the two dev-dependency cleanups that a rusqlite 0.37 resolution exposes.

What changed

Branch sw/rusqlite-0.37, based on tag v0.7.0, 5 commits:

  • aef479a — Cargo.toml: rusqlite 0.31.0 -> 0.37.0 (bundled feature unchanged).
  • 17be6be, e02a484 — Connection::pragma call sites: Some(rusqlite::DatabaseName::Main) -> Some("main") in src/io/sqlite_store/migrations.rs (2 sites) and src/io/sqlite_store/mod.rs (1 site). rusqlite 0.37 removed DatabaseName; the first parameter is now schema_name: Option<&str>.
  • 26ba14b — drops [target.'cfg(vss_test)'.dev-dependencies] ldk-node-062 = { package = "ldk-node", version = "=0.6.2" }. That dev-dep pulls a second libsqlite3-sys into resolution (not merely the build), which is what breaks downstream unification. It is only used by the cfg-disabled VSS backwards-compat test that needs a live VSS server.
  • d82a50e — [target.'cfg(not(no_download))'.dev-dependencies]: electrsd features reduced to ["legacy"], matching the existing cfg(no_download) entry. The esplora_* / corepc-node_* build scripts download release artifacts and hash-assert them; they panicked on upstream artifact drift here. This is the same effect as running with --cfg no_download, so the integration suites can still run with PATH-provided binaries.

Evidence

Downstream gate run (workspace build, clippy -D warnings, cargo tree single-copy assertion, cargo deny licenses, SQLCipher cipher test):
https://github.com/gdmaster3/SuperWallet/actions/runs/42470100999

Plus this fork's own cargo test --lib io::sqlite_store — PASS under the bumped pin (the module touched by the pragma change).

Caveats

  • VSS cfg(vss_test) dev-dep parity: removed rather than re-vendored. If you want it kept, I can re-add it as an explicitly non-default compat path (e.g. a path-patched ldk-node 0.6.2 carrying its own rusqlite bump); it should not remain a plain version dependency, since that alone breaks links = "sqlite3" unification downstream.
  • The electrsd / corepc-node edit is deliberately inert rather than a version bump: the observed failure was build-script artifact hash drift, not a compile error.

Notes for review

  • Targeted at release/0.7 (this branch is based on tag v0.7.0, so the PR diff is the 5 commits / 3 files). main already carries the equivalent modernizations (pragma_update, legacy-only electrsd, no ldk-node-062 resolution dep), so none of this is needed there.
  • Connection::pragma(Some("main"), ...) is the 0.37 signature (Option<&str>): https://docs.rs/rusqlite/0.37.0/rusqlite/struct.Connection.html#method.pragma
  • No CONTRIBUTING.md or PR template exists in this repository (only .github/workflows), so no stated title/CLA convention applies; commit messages follow the existing build: / ci: prefixes.
  • Happy to split this into separate PRs (bump vs. dev-dep cleanups) or to drop the dev-dep commits entirely if they are unwanted scope.

@ldk-reviews-bot

ldk-reviews-bot commented Nov 8, 2026 •

Copy link
Copy Markdown

I've assigned @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@gdmaster3
gdmaster3 changed the base branch from main to release/0.7 November 8, 2026 10:23
@ldk-reviews-bot
ldk-reviews-bot requested a review from tnull November 8, 2026 10:33

@tnull tnull left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there is a reason we did this way in #1187. We can't just require a newer SQLite, which a) would be incompatible with other crates in the rust-bitcoin ecosystem b) would technically be a SemVer violation if done in a patch release.

Superseded by #1225

@tnull tnull closed this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants