Skip to content

Build every family and take the wasm surface from the catalog - #19

Merged
estebanzimanyi merged 1 commit into
mainfrom
feat/derive-wasm-surface
Sep 2, 2026
Merged

Build every family and take the wasm surface from the catalog#19
estebanzimanyi merged 1 commit into
mainfrom
feat/derive-wasm-surface

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The generator emits a wrapper for every function the catalog marks public and
builds the #include preamble from the headers those functions come from, so the
emitted set and the declared set are one set. A header named in one list and
absent from the other is what leaves a wrapper calling a function no header
declares, which is how interval_eq and its siblings arrive undeclared.

The image builds MobilityDB with -DALL=ON and carries the wasm stages the
families that turns on need: zlib 1.3.1 and libxml2 2.13.5 for pgPointCloud's
libpc, and GDAL 3.9.3 for raster band sampling. GDAL takes every optional driver
off, since MEOS reads bands through the generic API, and the dependencies it
keeps, PROJ and SQLite, are ones this image already builds.

The emcc line asks pkg-config for the MEOS flags rather than naming an include
path. The installed meos.pc reports the include directory together with the
family macros the library carries, and the public headers gate declarations on
those macros, so a path given without them compiles the negative branch and loses
declarations whose symbols the archive exports. The configure step names the
install prefix for the same reason: meos.pc records the prefix given at
configure time, so a prefix supplied only to the install step leaves the file
naming the emscripten sysroot.

EMULATE_FUNCTION_POINTER_CASTS gives every indirect call one signature, as wide
as the widest function type linked in, and GDAL carries the widest, so the
fpcast-emu pass takes the parameter cap it names in its own diagnostic.

The surface is 3470 wrappers, 0 skipped and 0 duplicates, against 2839 exports.
pkg-config inside the image reports all ten families through -DS2CELL=1, and
the built meos.wasm carries tpcbox_make, meos_initialize_pointcloud,
posechain_in, s2cell_in, raster_value and timetz_in.

The generator emits a wrapper for every function the catalog marks public and
builds the `#include` preamble from the headers those functions come from, so the
emitted set and the declared set are one set. A header named in one list and
absent from the other is what leaves a wrapper calling a function no header
declares, which is how `interval_eq` and its siblings arrive undeclared.

The image builds MobilityDB with `-DALL=ON` and carries the wasm stages the
families that turns on need: zlib 1.3.1 and libxml2 2.13.5 for pgPointCloud's
libpc, and GDAL 3.9.3 for raster band sampling. GDAL takes every optional driver
off, since MEOS reads bands through the generic API, and the dependencies it
keeps, PROJ and SQLite, are ones this image already builds.

The emcc line asks `pkg-config` for the MEOS flags rather than naming an include
path. The installed `meos.pc` reports the include directory together with the
family macros the library carries, and the public headers gate declarations on
those macros, so a path given without them compiles the negative branch and loses
declarations whose symbols the archive exports. The configure step names the
install prefix for the same reason: `meos.pc` records the prefix given at
configure time, so a prefix supplied only to the install step leaves the file
naming the emscripten sysroot.

`EMULATE_FUNCTION_POINTER_CASTS` gives every indirect call one signature, as wide
as the widest function type linked in, and GDAL carries the widest, so the
`fpcast-emu` pass takes the parameter cap it names in its own diagnostic.

The surface is 3470 wrappers, 0 skipped and 0 duplicates, against 2839 exports.
`pkg-config` inside the image reports all ten families through `-DS2CELL=1`, and
the built `meos.wasm` carries `tpcbox_make`, `meos_initialize_pointcloud`,
`posechain_in`, `s2cell_in`, `raster_value` and `timetz_in`.

`TNumber.avgValue()` goes with it. The catalog marks `tnumber_avg_value`
internal, so the projection does not emit it, and the typed layers of the two
mature bindings agree: PyMEOS's `TNumber` and JMEOS's `TNumber` each expose
`integral` and the time-weighted average and neither exposes the plain one.
`timeWeightedAverage()` stays, on the public `tnumber_twavg`.
@estebanzimanyi
estebanzimanyi force-pushed the feat/derive-wasm-surface branch from ac3d0a2 to 3cdcedc Compare September 2, 2026 08:21
@estebanzimanyi
estebanzimanyi merged commit 999a3ab into main Sep 2, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the feat/derive-wasm-surface branch September 2, 2026 09:57
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.

1 participant