Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
core/src/sqlite/* linguist-vendored
py/perf/* linguist-documentation

core/rs/sqlite-rs-embedded/** linguist-vendored
4 changes: 2 additions & 2 deletions .github/workflows/c-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
if: runner.os == 'Windows'
run: |
rm core/rs/integration_check/rust-toolchain.toml
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-pc-windows-gnu
rustup default nightly-2023-10-05-x86_64-pc-windows-gnu
rustup component add rust-src --toolchain 1.93.0-x86_64-pc-windows-gnu
rustup default 1.93.0-x86_64-pc-windows-gnu

- name: Test
run: |
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:

- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add aarch64-apple-darwin --toolchain nightly-2023-10-05
rustup toolchain install nightly-2026-01-01
rustup target add aarch64-apple-darwin --toolchain nightly-2026-01-01

- name: Build MacOS Arm dylib
run: |
Expand Down Expand Up @@ -121,9 +121,9 @@ jobs:

- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add aarch64-unknown-linux-gnu --toolchain nightly-2023-10-05
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu
rustup toolchain install nightly-2026-01-01
rustup target add aarch64-unknown-linux-gnu --toolchain nightly-2026-01-01
rustup component add rust-src --toolchain nightly-2026-01-01-x86_64-unknown-linux-gnu

- name: Build
run: |
Expand Down Expand Up @@ -157,9 +157,9 @@ jobs:

- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add x86_64-pc-windows-gnu --toolchain nightly-2023-10-05
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu
rustup toolchain install nightly-2026-01-01
rustup target add x86_64-pc-windows-gnu --toolchain nightly-2026-01-01
rustup component add rust-src --toolchain nightly-2026-01-01-x86_64-unknown-linux-gnu

- name: mingw-w64
run: |
Expand Down Expand Up @@ -197,9 +197,9 @@ jobs:

- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add i686-pc-windows-gnu --toolchain nightly-2023-10-05
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu
rustup toolchain install nightly-2026-01-01
rustup target add i686-pc-windows-gnu --toolchain nightly-2026-01-01
rustup component add rust-src --toolchain nightly-2026-01-01-x86_64-unknown-linux-gnu

- name: mingw-w64
run: |
Expand Down Expand Up @@ -237,9 +237,9 @@ jobs:

- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add aarch64-linux-android --toolchain nightly-2023-10-05
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-unknown-linux-gnu
rustup toolchain install nightly-2026-01-01
rustup target add aarch64-linux-android --toolchain nightly-2026-01-01
rustup component add rust-src --toolchain nightly-2026-01-01-x86_64-unknown-linux-gnu

- uses: nttld/setup-ndk@v1
id: setup-ndk
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
if: runner.os == 'Windows'
run: |
find . -name rust-toolchain.toml -exec echo rm {} \;
rustup component add rust-src --toolchain nightly-2023-10-05-x86_64-pc-windows-gnu
rustup default nightly-2023-10-05-x86_64-pc-windows-gnu
rustup component add rust-src --toolchain 1.93.0-x86_64-pc-windows-gnu
rustup default 1.93.0-x86_64-pc-windows-gnu

- name: Test Fractindex
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/rs-valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ jobs:
- name: Test Fractindex
run: |
cd core/rs/fractindex-core
cargo valgrind test --features=loadable_extension
# Uncomment if u need to generate valgrind suppressions
# cargo test --features=loadable_extension
# find target/debug/deps/ -type f -executable -name "crsql*" -exec valgrind --leak-check=full --gen-suppressions=all {} \;
VALGRINDFLAGS="--suppressions=$GITHUB_WORKSPACE/core/valgrind.supp" cargo valgrind test --features=loadable_extension

- name: Test Core
run: |
cd core/rs/core
cargo valgrind test --features=loadable_extension
# Uncomment if u need to generate valgrind suppressions
# cargo test --features=loadable_extension
# find target/debug/deps/ -type f -executable -name "crsql*" -exec valgrind --leak-check=full --gen-suppressions=all {} \;
VALGRINDFLAGS="--suppressions=$GITHUB_WORKSPACE/core/valgrind.supp" cargo valgrind test --features=loadable_extension
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

5 changes: 5 additions & 0 deletions core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ $(TARGET_DBG_LOADABLE): $(dbg_prefix) $(ext_files) $(sqlite3.c) $(rs_lib_dbg_loa

# Build a SQLite CLI that pre-loads cr-sqlite.
# Useful for debugging.
# With DSQLITE_THREADSAFE!=0, The tests will crash on windows.
$(TARGET_SQLITE3): $(prefix) $(TARGET_SQLITE3_EXTRA_C) $(rs_lib_dbg_static_cpy) $(shell.c) $(ext_files)
$(CC) -g \
-DSQLITE_THREADSAFE=0 \
Expand Down Expand Up @@ -238,6 +239,7 @@ $(TARGET_STATIC): $(prefix) $(ext_files) $(sqlite3.c) $(rs_lib_static_cpy)
# Build a normal SQLite CLI that does not include cr-sqlite.
# cr-sqlite can be laoded in via the `.load` pragma.
# Useful for debugging.
# With DSQLITE_THREADSAFE!=0, The tests will crash on windows.
$(TARGET_SQLITE3_VANILLA): $(prefix) $(shell.c) $(sqlite3.c)
$(CC) -g \
$(DEFINE_SQLITE_PATH) \
Expand All @@ -250,6 +252,7 @@ $(TARGET_SQLITE3_EXTRA_C): $(prefix) $(sqlite3.c) src/core_init.c
cat $(sqlite3.c) src/core_init.c > $@

# run tests
# With DSQLITE_THREADSAFE!=0, The tests will crash on windows.
$(TARGET_TEST): $(prefix) $(TARGET_SQLITE3_EXTRA_C) src/tests.c src/*.test.c $(ext_files) $(rs_lib_dbg_static_cpy)
$(CC) -g -Wall \
-DSQLITE_THREADSAFE=0 \
Expand All @@ -260,6 +263,7 @@ $(TARGET_TEST): $(prefix) $(TARGET_SQLITE3_EXTRA_C) src/tests.c src/*.test.c $(e
$(TARGET_SQLITE3_EXTRA_C) src/tests.c src/*.test.c $(ext_files) $(rs_lib_dbg_static_cpy) \
$(LDLIBS) -o $@

# With DSQLITE_THREADSAFE!=0, The tests will crash on windows.
$(TARGET_TEST_ASAN): $(prefix) $(TARGET_SQLITE3_EXTRA_C) src/tests.c src/*.test.c $(ext_files) $(rs_lib_dbg_static_cpy)
$(CC) -fsanitize=address -g -fno-omit-frame-pointer -Wall \
-DSQLITE_THREADSAFE=0 \
Expand All @@ -270,6 +274,7 @@ $(TARGET_TEST_ASAN): $(prefix) $(TARGET_SQLITE3_EXTRA_C) src/tests.c src/*.test.
$(TARGET_SQLITE3_EXTRA_C) src/tests.c src/*.test.c $(ext_files) $(rs_lib_dbg_static_cpy) \
$(LDLIBS) -o $@

# With DSQLITE_THREADSAFE!=0, The tests will crash on windows.
$(TARGET_FUZZ): $(prefix) $(TARGET_SQLITE3_EXTRA_C) src/fuzzer.cc $(ext_files)
clang -fsanitize=fuzzer \
-DSQLITE_THREADSAFE=0 \
Expand Down
1 change: 1 addition & 0 deletions core/rs/bundle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ crate-type = ["rlib"]
crsql_fractindex_core = {path="../fractindex-core"}
crsql_core = { path="../core" }
sqlite_nostd = { path="../sqlite-rs-embedded/sqlite_nostd" }
stable_trap = { path="../sqlite-rs-embedded/stable_trap" }
libc-print = "*"

[profile.dev]
Expand Down
2 changes: 1 addition & 1 deletion core/rs/bundle/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2023-10-05"
channel = "1.93.0"
components = [ "rust-src", "rustfmt", "clippy" ]
16 changes: 9 additions & 7 deletions core/rs/bundle/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![no_std]
#![feature(core_intrinsics)]
#![feature(lang_items)]

extern crate alloc;

Expand All @@ -26,25 +24,29 @@ static ALLOCATOR: SQLite3Allocator = SQLite3Allocator {};
#[cfg(not(feature = "test"))]
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
core::intrinsics::abort()
stable_trap::abort()
}

// Print panic info for tests
#[cfg(feature = "test")]
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
println!("PANIC!: {}", info);
core::intrinsics::abort();
stable_trap::abort()
}

// Otherwise we would need to use nightly features
#[cfg(not(target_family = "wasm"))]
#[lang = "eh_personality"]
extern "C" fn eh_personality() {}
#[no_mangle]
extern "C" fn rust_eh_personality() {}
#[cfg(target_arch = "arm")]
#[no_mangle]
extern "C" fn _rust_eh_personality() {}

#[cfg(target_family = "wasm")]
#[no_mangle]
pub fn __rust_alloc_error_handler(_: Layout) -> ! {
core::intrinsics::abort()
stable_trap::abort()
}

#[no_mangle]
Expand Down
1 change: 1 addition & 0 deletions core/rs/bundle_static/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ crate-type = ["staticlib"]
[dependencies]
crsql_bundle = {path="../bundle"}


[profile.dev]
panic = "abort"

Expand Down
2 changes: 1 addition & 1 deletion core/rs/bundle_static/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2023-10-05"
channel = "1.93.0"

2 changes: 1 addition & 1 deletion core/rs/core/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2023-10-05"
channel = "1.93.0"
1 change: 0 additions & 1 deletion core/rs/core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg_attr(not(test), no_std)]
#![feature(vec_into_raw_parts)]

// TODO: these pub mods are exposed for the integration testing
// we should re-export in a `test` mod such that they do not become public apis
Expand Down
2 changes: 1 addition & 1 deletion core/rs/fractindex-core/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2023-10-05"
channel = "1.93.0"
1 change: 0 additions & 1 deletion core/rs/fractindex-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg_attr(not(test), no_std)]
#![allow(non_upper_case_globals)]
#![feature(core_intrinsics)]

mod as_ordered;
mod fractindex;
Expand Down
Loading
Loading