Conversation
2c1adac to
f79b193
Compare
|
Some CI checks are failing @ospfranco |
| [dependencies] | ||
| bytes = "1.5.0" | ||
| lazy_static = "1.4.0" | ||
| libsql = { path = "../../libsql", features = ["encryption"] } |
There was a problem hiding this comment.
This is not an acceptable change. Most of our projects that use C bindings depend on the encryption feature.
| edition = "2021" | ||
|
|
||
| [lib] | ||
| crate-type = ["cdylib", "staticlib"] |
There was a problem hiding this comment.
Removing cdylib for all targets is probably not acceptable.
bindings/c/Cargo.toml
Outdated
| hyper-rustls = { version = "0.25", features = ["webpki-roots"]} | ||
|
|
||
| [profile.release] | ||
| strip = "symbols" |
There was a problem hiding this comment.
This is something we need to talk about. Removing symbols makes debugging really hard. @penberg @MarinPostma @LucioFranco do you have any opinion about this?
There was a problem hiding this comment.
Tried this to reduce the size of the binary, Rust binaries are way to large for mobile targets. Currently with symbol stripping the binary sits at 60mbs, which is way too much.
Recently wrote more about this:
https://ospfranco.com/rust-reduce-binary-size/
I can remove it, but don't have the time to see how to apply stripping and lto optimization for conditional targets, did not find any documentation on how to do it.
There was a problem hiding this comment.
Then maybe comment it out with a note that it should be uncommented for android/ios builds to reduce the size of the binary
There was a problem hiding this comment.
It's already removed, I commented it out
| [toolchain] | ||
| profile = "default" | ||
| channel = "1.78.0" | ||
| targets = ["x86_64-apple-ios", "aarch64-apple-ios", "aarch64-apple-ios-sim", "aarch64-linux-android", "armv7-linux-androideabi", "x86_64-linux-android", "i686-linux-android"] |
There was a problem hiding this comment.
Don't we need a desktop targets for linux and macos as well?
There was a problem hiding this comment.
If you want, it makes it easier to set up cross compilation on new machines as you don't have to run the rustup install target ... commands but this is entirely optional
There was a problem hiding this comment.
This force the installation of too many toolchains that are useless most of the time, and it just broke my installation by creating conflicts.
There was a problem hiding this comment.
Feel free to remove it
There was a problem hiding this comment.
How did it create conflicts? It seems pretty harmless except for using some disk space, no?
|
Thanks for taking a look, however, I'm currently swamped with work and next week I'm going on vacation for several months. Feel free to take over this PR and modify it as you see fit:
After all is done and said, you only need to follow the guide I left you on notion to produce a static lib and run that against the opsqlite sample app. Once the emulator starts and everything is green you are ready to go. P.S. if you do turn on encryption, it will require a modification to the bindings to send the encryption key from JS, so, open a PR when the time comes and I will take a look. |
I'm not sure I will have capacity to take this PR over. Could you please finish it to the state that's mergable. Right now multiple CI checks are failing for it so it is impossible to accept such work and integrate it into the repository.
What does that mean? They are not needed? The changes that are required by Android and iOS need to be merged and if they are not compatible with other targets then they should be guarded with android or ios feature.
It's ok to disable the encryption for Android and maybe iOS for now but it should be done only for that targets not for all targets which breaks them.
Could you paste a link to that guide please? I haven't seen it yet.
|
afa98b0 to
5bfa592
Compare
Add steps for Android PR comments
5bfa592 to
bb63914
Compare
|
Leaving the guide to submitting updates to op-sqlite here for future reference: https://ospfranco.notion.site/Libsql-4dbbf5793f654eccb9f5f68901224e97 |
Adds the necessary scripts to build the C bindings for iOS and Android which the in turn only need to be dropped into iOS/Android projects to be used via Obj-C++ or Android's JNI.
For my specific use case I use them in op-sqlite.