Skip to content

WASM builds #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Oct 14, 2024
Merged

WASM builds #35

merged 11 commits into from
Oct 14, 2024

Conversation

rkistner
Copy link
Contributor

@rkistner rkistner commented Oct 10, 2024

This adds a side-module WASM build. After lots of back and forth, it turns out the simplest way to get this working is to remove workarounds used before. This now builds the wasm file directly using rust - no custom emcc calls required.

For static build for sqlite3, this now uses a staticlib crate-type, producing libpowersync.a. This also removes the need of the workarounds used before with the .bc files, and can significantly simplify the sqlite3 build.

See for more context on the dynamic lib: powersync-ja/wa-sqlite#16

Artifacts included in the release:

  • powersync.wasm - synchronous side-module, emscripten-only
  • powersync-async.wasm asyncify side-module, emscripten-only
  • libpowersync-wasm.a (static lib, works for synchronous emscripten, asyncify empscripten and plain wasi builds)

Example artifacts: image

@rkistner rkistner changed the title Emscripten WASM SIDE_MODULE WASM builds Oct 14, 2024
@rkistner rkistner marked this pull request as ready for review October 14, 2024 11:07
Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rkistner rkistner merged commit e3dad14 into main Oct 14, 2024
12 checks passed
@rkistner rkistner deleted the wasm-side-module branch October 14, 2024 11:18
@rkistner
Copy link
Contributor Author

Manually added the builds to v0.3.0 release.

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.

2 participants