Skip to content

Commit 6e73ec9

Browse files
committed
Test with stable Rust
1 parent 86594b3 commit 6e73ec9

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

.github/workflows/tests.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,40 @@ jobs:
186186
CORE_TEST_SQLITE=.dart_tool/sqlite3/latest/libsqlite3.dylib dart test -P skip_slow
187187
CORE_TEST_SQLITE=.dart_tool/sqlite3/minimum/libsqlite3.dylib dart test -P skip_slow
188188
189+
build_stable_rust:
190+
runs-on: ubuntu-latest
191+
steps:
192+
- uses: actions/checkout@v4
193+
with:
194+
submodules: true
195+
196+
- uses: dart-lang/setup-dart@v1
197+
- name: Install Rust Stable
198+
uses: dtolnay/rust-toolchain@stable
199+
200+
- uses: actions/cache@v4
201+
id: sqlite_build
202+
with:
203+
path: dart/.dart_tool/sqlite3/
204+
key: ${{ matrix.os }}-${{ hashFiles('dart/tool/') }}
205+
206+
- name: Setup Dart tests
207+
working-directory: dart
208+
run: |
209+
dart pub get
210+
dart run tool/download_sqlite3.dart
211+
dart analyze
212+
213+
- name: Compile with stable Rust
214+
run: |
215+
cargo +stable build -p powersync_loadable
216+
217+
- name: Dart tests with stable Rust
218+
working-directory: dart
219+
run: |
220+
CORE_TEST_SQLITE=.dart_tool/sqlite3/latest/libsqlite3.so dart test
221+
CORE_TEST_SQLITE=.dart_tool/sqlite3/minimum/libsqlite3.so dart test
222+
189223
valgrind:
190224
name: Testing with Valgrind on ${{ matrix.os }}
191225
runs-on: ${{ matrix.os }}

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cargo-features = ["panic-immediate-abort"]
2-
31
[workspace]
42

53
members = [

crates/loadable/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![no_std]
22
#![allow(internal_features)]
33
#![cfg_attr(feature = "nightly", feature(core_intrinsics))]
4+
#![cfg_attr(feature = "nightly", feature(lang_items))]
45

56
extern crate alloc;
67

@@ -30,4 +31,18 @@ mod panic_handler {
3031
fn panic(_info: &core::panic::PanicInfo) -> ! {
3132
loop {}
3233
}
34+
35+
#[cfg(not(target_family = "wasm"))]
36+
#[cfg(feature = "nightly")]
37+
#[lang = "eh_personality"]
38+
extern "C" fn eh_personality() {}
39+
40+
#[cfg(not(target_family = "wasm"))]
41+
#[cfg(not(feature = "nightly"))]
42+
#[unsafe(no_mangle)]
43+
extern "C" fn rust_eh_personality() {
44+
// This avoids missing _rust_eh_personality symbol errors.
45+
// This isn't used for any builds we distribute, but it's heplful to compile the library
46+
// with stable Rust, which we do for testing.
47+
}
3348
}

0 commit comments

Comments
 (0)