Fix PostGIS loading to use async WASM precompilation#895
Fix PostGIS loading to use async WASM precompilation#895larsmennen wants to merge 3 commits intoelectric-sql:tdrz/frontend-try-postgis2from
Conversation
|
@larsmennen Really cool, thank you!
Why wouldn't we remove the stripping instead? |
|
Hm, we're moving away from modifying the SDK (ie we don't want any hotfixes in the future) so ideally we wouldn't work on those files. @larsmennen with your change we're very close to having this working, just need to find a way without modifying the sdk (and btw this makes sense why it didn't already work - yet another reason to stay away from modifying the SDK). |
|
|
|
Thanks, that makes sense -- would be simpler. let me give that a go |
|
@tdrz that did the trick i think. i've removed the stripping of Browser test (the HTML in the PR description) also works. |
|
|
|
thx, done |
|
@larsmennen Build fails ... weird. I'll try to have a look this week, but can't promise anything. |
11a42e3 to
9690184
Compare
|
@larsmennen I've integrated your changes + fixes in the main PostGIS branch, thank you for finding the issue! |
This aims to fix loading of PostGIS in Chrome using async wasm precompilation to get around the 8mb browser limit.
Problem seemed to be that
createPreloadedFilewas called with the filename stripped of .so. Emscripten's wasm preload plugin checksname.endsWith('.so')incanHandle(), so it never activated. That's the main fix applied here and in the accompanying PR: electric-sql/postgres-pglite#63With the pglite-socket fix applied from #807 and muting the DEBUG messages as per same PR, I get the following test results:
The failing uninstall test is pre-existing I believe, as per similar comment in #807, though I can't get it to pass by turning off the DEBUG messages (seems to work for the other tests), but let me know if you think this might be related to this change.
As a test, this works in Chrome: