From 4ba9935c9e6bbbf875464fc31f2a5d27583f273b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Tue, 1 Sep 2026 00:53:19 +0200 Subject: [PATCH] Build the wrappers the tree carries rather than regenerating them The image regenerated the wrappers on the way to compiling them, which needs a catalog. The catalog is derived from MobilityDB rather than committed, so it is not in the tree the build context carries, and `npm run generate` stops on the file it cannot find. The workflow does not meet this because it stages a derived catalog before generating; `docker build` from a clean checkout has no such step. So the image takes the committed wrappers instead. That is also the question this build is worth asking: those wrappers are what a consumer of the published package compiles, and whether they still build against the MEOS they are linked to is decided here or nowhere, since regenerating first overwrites the evidence. Node goes with the generate step, its only use in this stage, and `bindings.c` comes out of `.dockerignore` because the image now consumes it rather than produces it. --- .dockerignore | 4 ++-- Dockerfile | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index 0d3c983..e02a379 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,7 @@ -# Build outputs / generated files +# Build outputs / generated files. core/c-src/bindings.c is NOT excluded: it is +# the committed projection this image compiles, not something the image produces. node_modules/ wasm/ -core/c-src/bindings.c dist/ coverage/ diff --git a/Dockerfile b/Dockerfile index 72616c4..b584255 100644 --- a/Dockerfile +++ b/Dockerfile @@ -167,13 +167,13 @@ COPY --from=mobilitydb_src /root/MobilityDB /root/MobilityDB WORKDIR /app -# Install node deps first (cached unless package.json or lock change) -COPY package.json package-lock.json ./ -RUN npm ci --ignore-scripts - -# Now copy the rest and generate bindings +# The wrappers are taken from the tree rather than regenerated here. They are a +# projection of the MEOS-API catalog, and the catalog is derived from MobilityDB +# rather than committed, so an image that regenerates needs a catalog the tree +# does not carry. Compiling the committed wrappers also makes this build answer +# the question that matters to a consumer of the published package, who compiles +# exactly these: that they still build against the MEOS they are linked to. COPY . . -RUN npm run generate # CMAKE: configure MobilityDB RUN INCLUDES="-I/root/geos/include -I/root/geos/build/capi -I/root/json-c-install/include -I/root/json-c-install/include/json-c" \