Skip to content

Commit d729feb

Browse files
remove rust setup. Re-enable extension functions.
1 parent f0e0e17 commit d729feb

File tree

13 files changed

+20
-67
lines changed

13 files changed

+20
-67
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ jobs:
3838
- run: |
3939
${{ steps.setup-chrome.outputs.chrome-path }} --version
4040
41-
- name: Rust Setup
42-
run: |
43-
rustup toolchain install nightly-2023-08-28-x86_64-unknown-linux-gnu
44-
rustup component add rust-src --toolchain nightly-2023-08-28-x86_64-unknown-linux-gnu
45-
4641
# Install yarn dependencies.
4742
- name: Get yarn cache directory path
4843
id: yarn-cache-dir-path
@@ -55,10 +50,6 @@ jobs:
5550
restore-keys: |
5651
${{ runner.os }}-yarn-
5752
- run: yarn install
58-
- name: Rust Setup
59-
run: |
60-
rustup toolchain install nightly-2024-05-18-x86_64-unknown-linux-gnu
61-
rustup component add rust-src --toolchain nightly-2024-05-18-x86_64-unknown-linux-gnu
6253

6354
- name: Test with checked-in WASM files
6455
run: yarn test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
!.yarn/versions
1010
.pnp.*
1111

12+
# PowerSync Rust Core
13+
libpowersync*.wasm
14+
1215
/cache
1316
/debug
1417
/deps

Makefile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# dependencies
2-
# TODO this should be 3.46.0, but there are build errors
3-
SQLITE_VERSION = version-3.44.0
2+
SQLITE_VERSION = version-3.46.0
43
SQLITE_TARBALL_URL = https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=${SQLITE_VERSION}
54

65
EXTENSION_FUNCTIONS = extension-functions.c
@@ -158,13 +157,23 @@ else
158157
endif
159158

160159

160+
# This hacks away a:
161+
# ```C
162+
# #define COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE=1
163+
# ```
164+
# statement in `extension-functions.c`.
165+
# The default setting causes ``extension-functions.c` to import SQLite3 with
166+
# ```C
167+
# #include "sqlite3ext.h"
168+
# ```
169+
# This results in undefined symbols during runtime when compiling the WASM with MAIN_MODULE=2.
161170
deps/$(EXTENSION_FUNCTIONS): cache/$(EXTENSION_FUNCTIONS)
162171
mkdir -p deps
163172
bash -c "$(OPENSSL_CHECK_CMD)"
164173
bash -c "$(HASH_CHECK_CMD)"
165174
rm -rf deps/sha3 $@
166-
cp 'cache/$(EXTENSION_FUNCTIONS)' $@
167-
175+
sed -i '' "/#define COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE/d" cache/$(EXTENSION_FUNCTIONS)
176+
cp cache/$(EXTENSION_FUNCTIONS) $@
168177
## tmp
169178
.PHONY: clean-tmp
170179
clean-tmp:
@@ -178,12 +187,6 @@ tmp/obj/dist/%.o: %.c
178187
mkdir -p tmp/obj/dist
179188
$(EMCC) $(CFLAGS_DIST) $(WASQLITE_DEFINES) $^ -c -o $@
180189

181-
# Use Linker true command switch which differs per OS
182-
ifeq ($(shell uname), Darwin)
183-
TRUE_CMD := /usr/bin/true
184-
else
185-
TRUE_CMD := /bin/true
186-
endif
187190

188191
## debug
189192
.PHONY: clean-debug

dist/wa-sqlite-async.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/wa-sqlite-async.wasm

34.7 KB
Binary file not shown.

dist/wa-sqlite-jspi.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/wa-sqlite-jspi.wasm

20.5 KB
Binary file not shown.

dist/wa-sqlite.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/wa-sqlite.wasm

20.5 KB
Binary file not shown.

src/exported_functions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,5 @@
258258
"_sqlite3_wal_checkpoint",
259259
"_sqlite3_wal_checkpoint_v2",
260260
"_sqlite3_wal_hook",
261-
"_setup_powersync",
262261
"_register_table_update_hook"
263262
]

0 commit comments

Comments
 (0)