Repository navigation
Backport 0.7: Widen rusqlite compatibility, use manual downloads
#1225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tnull
wants to merge
3
commits into
lightningdevkit:release/0.7
Choose a base branch
from
tnull:2026-11-backport-widen-rusqlite-0.7
base: release/0.7
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [package] | ||
| name = "ldk-node-rusqlite-compat" | ||
| version = "0.0.0" | ||
| edition = "2021" | ||
| rust-version = "1.85" | ||
| publish = false | ||
|
|
||
| # Resolve as a downstream application, without LDK Node's legacy test dependencies. | ||
| [workspace] | ||
|
|
||
| [dependencies] | ||
| ldk-node = { path = "../.." } | ||
| rusqlite = "=0.39.0" | ||
| tokio = { version = "1.39", features = ["macros", "rt"] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Downstream rusqlite compatibility | ||
|
|
||
| This separate Cargo workspace checks that an application can select a stock | ||
| rusqlite release while using LDK Node's default features. The test writes through | ||
| LDK Node, reopens the store, and reads the database with the application's rusqlite. | ||
| Neither rusqlite nor libsqlite3-sys is patched. | ||
|
|
||
| The root crate's development dependencies on LDK Node 0.6.2 and 0.7.0 require | ||
| rusqlite 0.31 unconditionally. They constrain root builds even when individual | ||
| tests are filtered out, but do not participate in downstream resolution. Keep | ||
| this fixture separate so CI actually tests both ends of the supported range. | ||
|
Comment on lines
+8
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One nit here: diff --git a/tests/rusqlite-compat/README.md b/tests/rusqlite-compat/README.md
index c27412e6..3b07c71e 100644
--- a/tests/rusqlite-compat/README.md
+++ b/tests/rusqlite-compat/README.md
@@ -5,9 +5,9 @@ rusqlite release while using LDK Node's default features. The test writes throug
LDK Node, reopens the store, and reads the database with the application's rusqlite.
Neither rusqlite nor libsqlite3-sys is patched.
-The root crate's development dependencies on LDK Node 0.6.2 and 0.7.0 require
-rusqlite 0.31 unconditionally. They constrain root builds even when individual
-tests are filtered out, but do not participate in downstream resolution. Keep
+The root crate's development dependency on LDK Node 0.6.2 requires
+rusqlite 0.31 unconditionally. It constrains root builds even when individual
+tests are filtered out, but does not participate in downstream resolution. Keep
this fixture separate so CI actually tests both ends of the supported range.
From the repository root, run: |
||
|
|
||
| From the repository root, run: | ||
|
|
||
| ```sh | ||
| export CARGO_TARGET_DIR=$(mktemp -d /tmp/cargo-target-ldk-node-rusqlite-XXXXXX) | ||
| export CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback | ||
| cargo +1.85.0 test --manifest-path tests/rusqlite-compat/Cargo.toml | ||
| ``` | ||
|
|
||
| The fixture defaults to the maximum tested version. To test another release, | ||
| change its direct requirement with | ||
| `cargo +1.85.0 add --manifest-path tests/rusqlite-compat/Cargo.toml rusqlite@=0.31.0` | ||
| and rerun the test. Restore the maximum requirement afterwards. The resolver | ||
| setting selects MSRV-compatible versions of unrelated transitive dependencies. | ||
|
|
||
| When changing the supported range, update both endpoints in | ||
| `.github/workflows/rust.yml` and test each newly included release locally. The | ||
| current upper bound excludes 0.40.0 and 0.40.1, which use `cfg_select!` and fail to | ||
| compile on Rust 1.85. Although the bundled-feature probe for 0.40.2 passes on | ||
| 1.85, Cargo cannot express a disjoint requirement that admits it while excluding | ||
| those earlier patches and retaining the older release lines. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // This file is Copyright its original authors, visible in version control history. | ||
| // | ||
| // This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
| // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or | ||
| // http://opensource.org/licenses/MIT>, at your option. You may not use this file except in | ||
| // accordance with one or both of these licenses. | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use ldk_node::io::sqlite_store::{ | ||
| SqliteStore, DEFAULT_KV_TABLE_NAME, DEFAULT_SQLITE_DB_FILE_NAME, | ||
| }; | ||
| use ldk_node::lightning::util::persist::KVStore; | ||
|
|
||
| #[tokio::test] | ||
| async fn persists_with_the_applications_rusqlite() { | ||
| let data_dir = | ||
| std::env::temp_dir().join(format!("ldk-node-rusqlite-compat-{}", std::process::id())); | ||
| let store = SqliteStore::new(data_dir.clone(), None, None).unwrap(); | ||
| KVStore::write(&store, "test", "", "key", vec![42]).await.unwrap(); | ||
| drop(store); | ||
|
|
||
| let store = SqliteStore::new(data_dir.clone(), None, None).unwrap(); | ||
| assert_eq!(KVStore::read(&store, "test", "", "key").await.unwrap(), vec![42]); | ||
| drop(store); | ||
|
|
||
| let connection = | ||
| rusqlite::Connection::open(data_dir.join(DEFAULT_SQLITE_DB_FILE_NAME)).unwrap(); | ||
| let value: Vec<u8> = connection | ||
| .query_row( | ||
| &format!("SELECT value FROM {DEFAULT_KV_TABLE_NAME} WHERE key = 'key'"), | ||
| [], | ||
| |row| row.get(0), | ||
| ) | ||
| .unwrap(); | ||
| assert_eq!(value, vec![42]); | ||
| drop(connection); | ||
| std::fs::remove_dir_all(data_dir).unwrap(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can fix CI by clearing the flags here like this: