Skip to content

Commit 86594b3

Browse files
committed
Introduce nightly feature
1 parent c0b2f7a commit 86594b3

File tree

9 files changed

+22
-19
lines changed

9 files changed

+22
-19
lines changed

.cargo/config.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# It was to fix this error when loading the loadable extension:
44
# undefined symbol: _Unwind_Resume
55
# Now, we instead build using:
6-
# -Z build-std=panic_immediate_abort,core,alloc
6+
# -Z build-std=panic_abort,core,alloc
77
# This fixes the same issue. We still keep -lgcc_eh,
88
# to support manual builds without -Z build-std.
99

@@ -17,13 +17,6 @@
1717
# 173K, loading works
1818
# Conclusion: -lgcc_eh has no effect when using -Z build-std.
1919

20-
[profile.release]
21-
panic = "immediate-abort"
22-
23-
[unstable]
24-
panic-immediate-abort = true
25-
build-std = ["core", "alloc", "panic_abort"]
26-
2720
[target.'cfg(target_os = "linux")']
2821
rustflags = [
2922
"-C", "link-arg=-lgcc_eh",

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ jobs:
102102

103103
- name: Build
104104
run: |
105-
# Need a debug build for the dart tests
106-
cargo build -p powersync_loadable
107-
108105
cargo build -p powersync_loadable --release
109106
cargo build -p powersync_core --release --features static
110107
cargo build -p powersync_sqlite --release
@@ -201,6 +198,11 @@ jobs:
201198
- uses: actions/checkout@v4
202199
with:
203200
submodules: true
201+
- name: Install Rust Nightly
202+
uses: dtolnay/rust-toolchain@stable
203+
with:
204+
toolchain: nightly-2025-10-31
205+
components: rust-src
204206

205207
- name: Install valgrind
206208
run: sudo apt update && sudo apt install -y valgrind

Cargo.toml

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

35
members = [

android/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ fun Exec.rustCompilation(project: String, output: String? = null) {
8383
"-Zbuild-std",
8484
"-p",
8585
project,
86+
"--features",
87+
"nightly"
8688
)
8789
}
8890

tool/build_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ function compile() {
55
local triple=$1
66
local suffix=$2
77

8-
cargo build -p powersync_loadable --features nightly,default --release --target $triple
9-
cargo build -p powersync_static --features nightly,default --release --target $triple
8+
cargo build -p powersync_loadable -Z build-std=panic_abort,core,alloc --features nightly --release --target $triple
9+
cargo build -p powersync_static -Z build-std=panic_abort,core,alloc --features nightly --release --target $triple
1010

1111
mv "target/$triple/release/libpowersync.so" "libpowersync_$suffix.linux.so"
1212
mv "target/$triple/release/libpowersync.a" "libpowersync_$suffix.linux.a"

tool/build_macos.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ function compile() {
66
local suffix=$2
77
local os=$3
88

9-
cargo build -p powersync_loadable --features nightly,default --release --target $triple
10-
cargo build -p powersync_static --features nightly,default --release --target $triple
9+
cargo build -p powersync_loadable -Z build-std=panic_abort,core,alloc --features nightly --release --target $triple
10+
cargo build -p powersync_static -Z build-std=panic_abort,core,alloc --features nightly --release --target $triple
1111

1212
mv "target/$triple/release/libpowersync.dylib" "libpowersync_$suffix.$os.dylib"
1313
mv "target/$triple/release/libpowersync.a" "libpowersync_$suffix.$os.a"

tool/build_wasm.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUSTFLAGS="-C link-arg=-sSIDE_MODULE=2" \
1010
--profile wasm \
1111
--no-default-features \
1212
--features "powersync_core/static powersync_core/omit_load_extension sqlite_nostd/omit_load_extension nightly" \
13+
-Z build-std=panic_abort,core,alloc \
1314
--target wasm32-unknown-emscripten
1415

1516
cp "target/wasm32-unknown-emscripten/wasm/powersync.wasm" "libpowersync.wasm"
@@ -22,6 +23,7 @@ RUSTFLAGS="-C link-arg=-sSIDE_MODULE=2 -C link-arg=-sASYNCIFY=1 -C link-arg=-sJS
2223
--profile wasm_asyncify \
2324
--no-default-features \
2425
--features "powersync_core/static powersync_core/omit_load_extension sqlite_nostd/omit_load_extension nightly" \
26+
-Z build-std=panic_abort,core,alloc \
2527
--target wasm32-unknown-emscripten
2628

2729
cp "target/wasm32-unknown-emscripten/wasm_asyncify/powersync.wasm" "libpowersync-async.wasm"
@@ -36,6 +38,7 @@ cargo build \
3638
--profile wasm \
3739
--no-default-features \
3840
--features "powersync_core/static powersync_core/omit_load_extension sqlite_nostd/omit_load_extension nightly" \
41+
-Z build-std=panic_abort,core,alloc \
3942
--target wasm32-wasip1
4043

4144
cp "target/wasm32-wasip1/wasm/libpowersync.a" "libpowersync-wasm.a"

tool/build_windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ function compile() {
55
local triple=$1
66
local suffix=$2
77

8-
cargo build -p powersync_loadable --features nightly,default --release --target $triple
9-
cargo build -p powersync_static --features nightly,default --release --target $triple
8+
cargo build -p powersync_loadable -Z build-std=panic_abort,core,alloc --features=nightly --release --target $triple
9+
cargo build -p powersync_static -Z build-std=panic_abort,core,alloc --features=nightly --release --target $triple
1010

1111
mv "target/$triple/release/powersync.dll" "powersync_$suffix.dll"
1212
mv "target/$triple/release/powersync.lib" "powersync_$suffix.lib"

tool/build_xcframework.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ for TARGET in ${TARGETS[@]}; do
188188
-p powersync_static \
189189
--profile release_apple \
190190
--features nightly \
191-
--target $TARGET
191+
--target $TARGET \
192+
-Zbuild-std
192193
else
193-
cargo build -p powersync_loadable --profile release_apple --features nightly --target $TARGET
194+
cargo build -p powersync_loadable --profile release_apple --features nightly --target $TARGET -Zbuild-std
194195
fi
195196
done
196197

0 commit comments

Comments
 (0)