From 531f3df3fa7b5ad6326fe4f3630a66016ac51c7d Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Mon, 2 Jun 2025 16:53:44 +0200 Subject: [PATCH 1/4] Update Rust toolchain --- .github/workflows/android.yml | 4 ++-- .github/workflows/ios.yml | 4 ++-- .github/workflows/linux.yml | 4 ++-- .github/workflows/macos.yml | 4 ++-- .github/workflows/release.yml | 20 ++++++++++---------- .github/workflows/tests.yml | 2 +- .github/workflows/wasm.yml | 6 +++--- .github/workflows/windows.yml | 2 +- rust-toolchain.toml | 2 +- tool/build_wasm.sh | 7 ++++--- 10 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 4b1231f..5c09328 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -22,8 +22,8 @@ jobs: - name: Setup run: | - rustup toolchain install nightly-2024-05-18-x86_64-unknown-linux-gnu - rustup component add rust-src --toolchain nightly-2024-05-18-x86_64-unknown-linux-gnu + rustup toolchain install nightly-2025-04-15-x86_64-unknown-linux-gnu + rustup component add rust-src --toolchain nightly-2025-04-15-x86_64-unknown-linux-gnu rustup target add \ aarch64-linux-android \ armv7-linux-androideabi \ diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index aebd68e..4c6057e 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -14,8 +14,8 @@ jobs: - name: Setup run: | - rustup toolchain install nightly-2024-05-18-aarch64-apple-darwin - rustup component add rust-src --toolchain nightly-2024-05-18-aarch64-apple-darwin + rustup toolchain install nightly-2025-04-15-aarch64-apple-darwin + rustup component add rust-src --toolchain nightly-2025-04-15-aarch64-apple-darwin rustup target add \ x86_64-apple-darwin \ aarch64-apple-darwin \ diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a91d5bf..0e8d7cb 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -15,7 +15,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build binaries @@ -33,7 +33,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build binaries diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 67d24fa..a59e0cd 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -15,7 +15,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build binary @@ -33,7 +33,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build binary diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36028f3..9c9564b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,8 +52,8 @@ jobs: - name: Setup run: | - rustup toolchain install nightly-2024-05-18-x86_64-unknown-linux-gnu - rustup component add rust-src --toolchain nightly-2024-05-18-x86_64-unknown-linux-gnu + rustup toolchain install nightly-2025-04-15-x86_64-unknown-linux-gnu + rustup component add rust-src --toolchain nightly-2025-04-15-x86_64-unknown-linux-gnu rustup target add \ aarch64-linux-android \ armv7-linux-androideabi \ @@ -84,8 +84,8 @@ jobs: - name: Setup run: | - rustup toolchain install nightly-2024-05-18-aarch64-apple-darwin - rustup component add rust-src --toolchain nightly-2024-05-18-aarch64-apple-darwin + rustup toolchain install nightly-2025-04-15-aarch64-apple-darwin + rustup component add rust-src --toolchain nightly-2025-04-15-aarch64-apple-darwin rustup target add \ x86_64-apple-darwin \ aarch64-apple-darwin \ @@ -153,7 +153,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build binaries @@ -178,7 +178,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build binaries @@ -203,7 +203,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build binary @@ -228,7 +228,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build binary @@ -253,7 +253,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build binary @@ -278,7 +278,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Setup emsdk diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 20ec38d..3d771bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index eab0977..a37d3ab 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -8,20 +8,20 @@ jobs: if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Setup emsdk uses: mymindstorm/setup-emsdk@v14 with: - version: 3.1.68 + version: 4.0.7 - name: Build WASM run: ./tool/build_wasm.sh diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index fa13aab..5ac33a3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -15,7 +15,7 @@ jobs: - name: Install Rust Nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-18 + toolchain: nightly-2025-04-15 components: rust-src - name: Build binary diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e418b22..5d54722 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-05-18" +channel = "nightly-2025-04-15" diff --git a/tool/build_wasm.sh b/tool/build_wasm.sh index da505e7..f40d8ed 100755 --- a/tool/build_wasm.sh +++ b/tool/build_wasm.sh @@ -1,5 +1,6 @@ #!/bin/bash set -e +emcc --version # Normal build # target/wasm32-unknown-emscripten/wasm/powersync.wasm @@ -31,13 +32,13 @@ cp "target/wasm32-unknown-emscripten/wasm_asyncify/powersync.wasm" "libpowersync # Static lib. # Works for both sync and asyncify builds. # Works for both emscripten and wasi. -# target/wasm32-wasi/wasm/libpowersync.a +# target/wasm32-wasip1/wasm/libpowersync.a cargo build \ -p powersync_loadable \ --profile wasm \ --no-default-features \ --features "powersync_core/static powersync_core/omit_load_extension sqlite_nostd/omit_load_extension" \ -Z build-std=panic_abort,core,alloc \ - --target wasm32-wasi + --target wasm32-wasip1 -cp "target/wasm32-wasi/wasm/libpowersync.a" "libpowersync-wasm.a" +cp "target/wasm32-wasip1/wasm/libpowersync.a" "libpowersync-wasm.a" From 737065db7fbde58ac91232dd0e7618e65b741bef Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Mon, 2 Jun 2025 16:56:53 +0200 Subject: [PATCH 2/4] Fix some compilation warnings --- crates/core/src/checkpoint.rs | 1 - crates/core/src/diff.rs | 1 - crates/core/src/fix_data.rs | 2 +- crates/core/src/json_merge.rs | 1 - crates/core/src/lib.rs | 1 - crates/core/src/uuid.rs | 1 - crates/loadable/src/lib.rs | 1 - 7 files changed, 1 insertion(+), 7 deletions(-) diff --git a/crates/core/src/checkpoint.rs b/crates/core/src/checkpoint.rs index 1e6527d..32e2902 100644 --- a/crates/core/src/checkpoint.rs +++ b/crates/core/src/checkpoint.rs @@ -1,6 +1,5 @@ extern crate alloc; -use alloc::format; use alloc::string::String; use alloc::vec::Vec; use core::ffi::c_int; diff --git a/crates/core/src/diff.rs b/crates/core/src/diff.rs index 7e5ad18..fd37a05 100644 --- a/crates/core/src/diff.rs +++ b/crates/core/src/diff.rs @@ -1,6 +1,5 @@ extern crate alloc; -use alloc::format; use alloc::string::{String, ToString}; use core::ffi::c_int; diff --git a/crates/core/src/fix_data.rs b/crates/core/src/fix_data.rs index ec9c0da..8dcab1b 100644 --- a/crates/core/src/fix_data.rs +++ b/crates/core/src/fix_data.rs @@ -117,7 +117,7 @@ fn remove_duplicate_key_encoding(key: &str) -> Option { } fn powersync_remove_duplicate_key_encoding_impl( - ctx: *mut sqlite::context, + _ctx: *mut sqlite::context, args: &[*mut sqlite::value], ) -> Result, SQLiteError> { let arg = args.get(0).ok_or(ResultCode::MISUSE)?; diff --git a/crates/core/src/json_merge.rs b/crates/core/src/json_merge.rs index 80c1687..cb31479 100644 --- a/crates/core/src/json_merge.rs +++ b/crates/core/src/json_merge.rs @@ -1,6 +1,5 @@ extern crate alloc; -use alloc::format; use alloc::string::{String, ToString}; use core::ffi::c_int; diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index 995e5f9..017a954 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -2,7 +2,6 @@ #![feature(vec_into_raw_parts)] #![allow(internal_features)] #![feature(core_intrinsics)] -#![feature(error_in_core)] #![feature(assert_matches)] extern crate alloc; diff --git a/crates/core/src/uuid.rs b/crates/core/src/uuid.rs index db617f9..82d9046 100644 --- a/crates/core/src/uuid.rs +++ b/crates/core/src/uuid.rs @@ -1,6 +1,5 @@ extern crate alloc; -use alloc::format; use alloc::string::String; use alloc::string::ToString; use core::ffi::c_int; diff --git a/crates/loadable/src/lib.rs b/crates/loadable/src/lib.rs index c6ca649..9e5a9de 100644 --- a/crates/loadable/src/lib.rs +++ b/crates/loadable/src/lib.rs @@ -3,7 +3,6 @@ #![feature(core_intrinsics)] #![allow(internal_features)] #![feature(lang_items)] -#![feature(error_in_core)] extern crate alloc; From dd86b090b1887764aa91816954621b002683131a Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Mon, 2 Jun 2025 17:18:40 +0200 Subject: [PATCH 3/4] Disable strip to debug memory leak --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3506783..d0bad59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ default-members = ["crates/shell", "crates/sqlite"] [profile.dev] panic = "abort" -strip = true +strip = false [profile.release] panic = "abort" From 5ea5951fb610219fe7f6d8c72a5a544c34b9f359 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Tue, 3 Jun 2025 09:36:27 +0200 Subject: [PATCH 4/4] Remove strip on dev builds --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d0bad59..eb7eb75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ default-members = ["crates/shell", "crates/sqlite"] [profile.dev] panic = "abort" -strip = false [profile.release] panic = "abort"