Build the WebAssembly module in CI - #13
Open
estebanzimanyi wants to merge 2 commits into
Open
Conversation
The module compiled against MobilityDB's source tree, where meos.h is not the header MEOS publishes. MEOS assembles the installed <meos.h>: it splices its PostgreSQL-compat definitions into it under #ifndef POSTGRES_H, which supplies Datum, DateADT, TimestampTz, Interval and the de-prefixed base I/O -- interval_in, date_in, timestamptz_in and their siblings, named without a meos_ prefix so they do not collide with a real PostgreSQL. None of that is in the source copy, so calls to those functions were implicitly declared and C99 rejects them. The build installs MEOS and compiles against that prefix. The preamble stops including the vendored <postgres.h>, which defined POSTGRES_H first and made <meos.h> skip the whole spliced block, and takes <string.h> directly rather than through it. The Datum accessors the spliced block leaves out are defined here, keyed on the pointer width exactly as PostgreSQL keys USE_FLOAT8_BYVAL on SIZEOF_VOID_P >= 8. With -sMEMORY64=1 a Datum is 8 bytes, so a TimestampTz or an int64 span bound rides inside it rather than behind a pointer; reading one through a pointer returns whatever the value addresses, which makes a bigint span report a neighbour it does not touch as adjacent. Both widths stay correct.
The workflow regenerates and type-checks, which leaves the C wrappers unbuilt: a wrapper calling a function no header declares passes both steps and fails only in the Docker emscripten build nobody runs. The job builds the module through that Dockerfile target. The MobilityDB clone layer is excluded from the cache, since it clones master and a cached copy would freeze MEOS at whatever commit first populated the cache; the dependency stages build pinned releases and cache safely, which is what makes the job affordable.
estebanzimanyi
force-pushed
the
ci/wasm-build-and-test
branch
from
August 15, 2026 15:53
8368086 to
153b4dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The branch carries the installed-header fix beneath it; the second commit is the one to review.
A job builds the WebAssembly module through the Dockerfile target, so the C wrappers are compiled on every push and pull request.
Regenerating and type-checking leaves those wrappers unbuilt: a wrapper calling a function no header declares passes both steps and fails only in the Docker emscripten build, which nothing runs.
The MobilityDB clone layer is excluded from the cache. It clones master, so a cached copy freezes MEOS at whatever commit first populated the cache and the job stops testing what it claims to. The dependency stages build pinned releases and cache safely, which is what keeps the job affordable.
The job stops at the build and runs no tests. Instantiating the module under Node raises
CompileError: invalid table elements limits flags, which belongs to the-sMEMORY64=1build rather than to anything the job compiles — a module built from the commit before this branch fails identically. A test step therefore reports that runtime gap as a build failure on every pull request, and closing the gap comes first.