Skip to content

Turn libsqlite3-sys in a !#[no_std] crate#1765

Closed
weiznich wants to merge 1 commit intorusqlite:masterfrom
GiGainfosystems:no_std
Closed

Turn libsqlite3-sys in a !#[no_std] crate#1765
weiznich wants to merge 1 commit intorusqlite:masterfrom
GiGainfosystems:no_std

Conversation

@weiznich
Copy link
Contributor

@weiznich weiznich commented Dec 6, 2025

There is no reason why this bindings crate needs std lib support. We can just instruct bindgen to generate imports for the relevant core types instead.

This is the first step to run libsqlite3-sys in a no-std environment.

For now this is marked as a draft to get some feedback on the idea itself and because https://github.com/rusqlite/rusqlite/blob/master/libsqlite3-sys/bindgen-bindings/bindgen_3.34.1.rs is not converted yet. Any pointer/documentation on how to regenerate this file would be helpful

There is no reason why this bindings crate needs std lib support. We can
just instruct bindgen to generate imports for the relevant core types
instead.

This is the first step to run libsqlite3-sys in a no-std environment.
@gwenn
Copy link
Collaborator

gwenn commented Dec 7, 2025

I've regenerated the remaining bindgen files here: #1767
For sqlcipher, you just need to launch upgrade_sqlcipher.sh
For bindgen-bindings/bindgen_*.rs files, you need to temporary edit upgrade.sh:

diff --git a/libsqlite3-sys/upgrade.sh b/libsqlite3-sys/upgrade.sh
index d44e91c..b1d94a4 100755
--- a/libsqlite3-sys/upgrade.sh
+++ b/libsqlite3-sys/upgrade.sh
@@ -9,8 +9,8 @@ export SQLITE3_LIB_DIR="$SCRIPT_DIR/sqlite3"
 mkdir -p "$TARGET_DIR" "$SQLITE3_LIB_DIR"

 # Download and extract amalgamation
-SQLITE=sqlite-amalgamation-3510100
-curl -O https://sqlite.org/2025/$SQLITE.zip
+SQLITE=sqlite-amalgamation-3340100
+curl -O https://sqlite.org/2021/$SQLITE.zip
 unzip -p "$SQLITE.zip" "$SQLITE/sqlite3.c" > "$SQLITE3_LIB_DIR/sqlite3.c"
 unzip -p "$SQLITE.zip" "$SQLITE/sqlite3.h" > "$SQLITE3_LIB_DIR/sqlite3.h"
 unzip -p "$SQLITE.zip" "$SQLITE/sqlite3ext.h" > "$SQLITE3_LIB_DIR/sqlite3ext.h"

launch it and move the generated files...

@gwenn gwenn closed this in #1767 Dec 7, 2025
@weiznich
Copy link
Contributor Author

weiznich commented Dec 9, 2025

Thanks for the fast fix and thanks for explaining how it works. That's really appreciated

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.

2 participants