Skip to content

Conversation

@simolus3
Copy link
Contributor

Being able to compile the core extension with stable Rust is a first step towards distributing a native SDK as a Rust crate. The current approach of downloading the core extension as a prebuilt binary restricts available platforms and isn't exactly a good practice.

Before this PR, the core crate used the following features only available on nightly builds:

  • btree_set_entry: This is mostly an optimization to avoid traversing a btree twice when doing an insert-if-not-exists. We're not using that in any particularly hot code, so we can replace that feature with two calls for now.
  • assert_matches: This prints a nicer error message than assert!(matches! on failures, but we don't strictly need this either.
  • strict_overflow_ops: This has been stabilized in Rust 1.91, released yesterday!
  • vec_into_raw_parts: We haven't actually been using this at all.

So, this PR removes all unstable features from core, allowing that to be compiled with stable Rust.

For testing purposes only, this also adds panic handlers and eh_personality items to loadable that compile on stable Rust (the existing behavior is behind the nightly feature now, and that feature is enabled for release builds). This then adds a workflow task building the loadable extension on stable Rust and running Dart tests with it.

There are additional roadblocks necessary to get powersync_core into a stable that could be released to crates.io (in particular, we'd have to vendor sqlite-nostd into the crate), but this is a first step.

@simolus3 simolus3 requested a review from rkistner October 31, 2025 11:00
@simolus3 simolus3 merged commit 6e73ec9 into main Oct 31, 2025
25 checks passed
@simolus3 simolus3 deleted the stable branch October 31, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants