duckdb: Build fails on node:16

What happens?

No prebuilt binaries are available for node 16 (LTS release prepared for next week) on nodejs official docker image https://duckdb-node.s3.amazonaws.com/duckdb-v0.3.0-node-v93-linux-x64.tar.gz.

When npm attempts to build from source, there are no indications about missing dependencies in the environment before proceeding.

To Reproduce

docker build -t node-16-duckdb - <<EOF
FROM node:16
RUN apt-get update -y -qq && apt-get install -y -qq ninja-build ccache && apt-get clean

WORKDIR /app
# keep this layer appending `|| true`
RUN npm init -y && npm i duckdb -s --loglevel verbose || true 

the log

docker run --rm --entrypoint /bin/bash -a stdout bermi/node-duckdb -c "cat /root/.npm/_logs/*-debug.log"

shows

970 error ../src/database.cpp: In constructor 'node_duckdb::Database::Database(const Napi::CallbackInfo&)':
970 error ../src/database.cpp:67:6: warning: variable 'mode' set but not used [-Wunused-but-set-variable]
970 error   int mode = 0;
970 error       ^~~~

I tried removing the dead code on this repo but I still had the unused-but-set-variable error from third party dependencies

58 error gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
58 error third_party/libpg_query/scan.l: In function 'int duckdb_libpgquery::core_yylex(duckdb_libpgquery::core_YYSTYPE*, int*, duckdb_libpgquery::yyscan_t)':
58 error third_party/libpg_query/scan.l:759:12: warning: variable 'identlen' set but not used [-Wunused-but-set-variable]
58 error third_party/libpg_query/scan.l:774:12: warning: variable 'identlen' set but not used [-Wunused-but-set-variable]
58 error g++: fatal error: Killed signal terminated program cc1plus

Environment (please complete the following information):

  • OS: Ubuntu or MacOS if cmake is missing
  • DuckDB Version: 0.3.0
  • DuckDB Client: nodejs

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Are you able to confirm if this is resolved with the latest version of DuckDB?

Yeah, the latest DuckDB on Node v18+ vends the pre-built via NPM for Debians just fine.

Just an update that what we ended up doing was finding a node version + platform arch for which there were prebuilt binaries and then just made sure our docker container fit those specifications. In our case we used a node:14 base image and ran docker build with a --platform linux/amd64 arg.

After digging into this for awhile last night, I was able to silence the warnings, but the build was still failing. What finally fixed it for me was upping the Docker VM’s memory (in Docker Desktop, you can find it in preferences), so I think the GCC warnings are just a red herring. I turned the warnings back on and, with the new memory settings, the build still succeeded.

@bermi - have you tried upping the memory available to your Docker VM?