Initial support for stable Rust #143
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
corecrate 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 thanassert!(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_personalityitems toloadablethat compile on stable Rust (the existing behavior is behind thenightlyfeature 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_coreinto a stable that could be released to crates.io (in particular, we'd have to vendorsqlite-nostdinto the crate), but this is a first step.