0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-06-17 21:59:05 +00:00

26 Commits

Author SHA1 Message Date
897ae8beac libsql-ffi: Make CC and CXX configurable ()
Make CC and CXX configurable for the build process. Allows us to, for
example, make sure we're building with just clang on macOS.
2024-04-02 14:40:30 +00:00
c45e72d0a6 libsql-ffi: Fix sqlite3mc build output directory ()
Don't build inside the source tree because `cargo clean` won't clean up
after it...
2024-03-25 16:45:26 +00:00
234e5d4871 Fixed function make_amalgamation naming typo ()
Use `amalgamation` instead of `amalgation`.

Ref: https://www.merriam-webster.com/dictionary/amalgamation
2024-03-12 10:27:42 +00:00
47fef88f19 ffi: blocklist wasm fns from bindgen () 2024-03-07 20:13:39 +00:00
fd6afb784f libsql-ffi: Disable stack protector for sqlite3mc on musl ()
The stack protector links to symbols like `strcpy_chk`, which are not
available on musl. Therefore, disable it.

Fixes 
2024-03-07 11:59:26 +00:00
0cb88082ef Fix build ()
Signed-off-by: Piotr Jastrzebski <piotr@chiselstrike.com>
2024-02-28 14:08:03 +00:00
8fd841d87d libsq-ffi: Drop git submodule trickery from sqlite3mc build ()
As Lucio points out, we no longer do submodules for sqlite3mc so let's
just drop the bogus `git submodule update` invocation.
2024-02-16 15:31:52 +00:00
86172b548e Fix sqlite3mc build ()
* libsql-ffi: Enable PIC for sqlite3mc build

I am seeing the following build error when building the libsql-ffi crate
on Linux/x86-64:

```
/usr/bin/ld:
/tmp/rustcYVhHYo/liblibsql_ffi-20adf4ca11d8e922.rlib(sqlite3mc.c.o):
relocation R_X86_64_32S against `.rodata' can not be used when making a
shared object; recompile with -fPIC
```

Let's turn on PIC for sqlite3mc to fix the problem.

* libsql-ffi: Fix sqlite3mc build under `cross`

We need to use the C compiler configured by `cross` with sqlite3mc;
otherwise we end up building with the host compiler, resulting in errors
like this:

```
  = note: /usr/lib/gcc-cross/aarch64-linux-gnu/5/../../../../aarch64-linux-gnu/bin/ld: /tmp/rustcJ70WRo/liblibsql_ffi-5d7e6e8037dbda37.rlib(sqlite3mc.c.o): Relocations in generic ELF (EM: 62)
```

* libsql-ffi: Rewrite build_libsqlite3mc.sh in Rust

The bash shell script is turning out to be painful to run on Windows so
let's just rewrite the logic in Rust and place it in `build.rs`.
2024-02-14 15:26:16 +00:00
02b9e82945 chore: don't rebuild ffi without ciphers () 2024-02-13 16:31:11 +00:00
37fb629f50 run clippy () 2024-01-31 08:42:20 +00:00
f05f349c06 chore: fix ffi build with all features ()
* chore: fix ffi build with all features

* set flags only for clang

* Update libsql-ffi/build.rs
2024-01-25 21:03:11 +00:00
58eda02bb3 chore: fix ffi build script again ()
* chore: fix ffi build script again

* ffi: separate building and copying for cipher code

* build dylib if it doesn't exist

* fix wasm builds with ciphers
2024-01-24 22:02:51 +00:00
975646e034 libsql: add local sync write delegation ()
* libsql: add local sync write delegation

* add additional query check to local sync test
2024-01-24 20:39:04 +00:00
dd0e23c81c fix docker build 2024-01-24 11:03:03 +01:00
d9a9f44ecd libsql-ffi: add c11 flag to make build compatible with old compilers 2024-01-22 21:43:07 -03:00
ad5ff8d171 libsql-ffi: deduplicate sqlite3.c amalgamations
From now on, SQLite3MultipleCiphers will use the amalgamation
file kept in libsql-ffi/bundled/src.
2024-01-19 08:22:57 +01:00
d149ecebd8 libsql-ffi: compile-in Wasm conditionally with encryption enabled 2024-01-19 08:22:57 +01:00
dedbdd03b3 Merge pull request from tursodatabase/sqlite3mc_part0
Encryption at rest preparations: integrate with SQLite3MultipleCiphers
2024-01-11 18:23:01 +00:00
f0929037d1 chore: fix ffi build script 2024-01-10 09:53:19 -05:00
c504f8311b libsql-ffi: move multiple-ciphers support to a feature
Enabled with `cargo build -F multiple-ciphers`
2024-01-09 18:12:02 +01:00
c74fb49f5c still hacky, but compiles lib instead of shipping precompiled 2024-01-09 18:12:02 +01:00
253a295865 encryption demo: based on precompiled libsqlite3mc.so
** DEEP, DEEP DRAFT **

The prebuilt library is from my fork:
https://github.com/psarna/SQLite3MultipleCiphers

The key is hardcoded to "heyhey".

After you run sqld with this patch, all data is encoded on disk
with a "heyhey" key. You can't read it directly from the file,
unless you use sqlite3mc's shell and start with
 > PRAGMA KEY=heyhey;

, and then it gets properly decrypted.

** TODO **
1. We need to adopt SQLite3MultipleCiphers source code and integrate
   with our build system, if we want to use it.
2. Pretty sure the hardcoded "heyhey" passphrase won't pass SOC2,
   but I need to consult that with a lawyer.
2024-01-09 18:12:02 +01:00
30f998cac9 sqld: small debug additions and ignore clean up 2023-12-11 15:39:49 -05:00
425b370fb1 fix ffi build.rs 2023-12-08 17:57:34 +01:00
176d6c4376 add wasmtime-bindings feature to libsql-sys 2023-11-30 11:24:51 +01:00
477af9bef6 introduce libsql-ffi 2023-11-15 11:08:51 +01:00