Level / rocksdb

Pure C++ Node.js RocksDB binding. An abstract-leveldown compliant store.
MIT License
229 stars 53 forks source link

Installation falls back to build-from-source in NodeJS 20.12 #228

Open bolt-juri-gavshin opened 5 months ago

bolt-juri-gavshin commented 5 months ago

Starting from NodeJS 20.12.0, npm install always builds from source with the following error:

#7 2.704 npm info run rocksdb@5.2.1 install node_modules/rocksdb node-gyp-build
#7 2.704 
#7 2.704 > rocksdb@5.2.1 install
#7 2.704 > node-gyp-build
#7 2.704 
#7 2.806 terminate called after throwing an instance of 'std::bad_alloc'
#7 2.806   what():  std::bad_alloc
#7 2.806 Aborted
#7 2.806

Dockerfile to reproduce:

FROM node:20.12.0-bookworm
WORKDIR /app
RUN echo 'foreground-scripts = true' >> .npmrc
RUN npm install rocksdb@5.2.1 --force --loglevel=verbose

Not sure, whether the bug is in NodeJS or rocksdb or node-gyp-build, but this code worked fine in NodeJS 16, 18 and 20.11.

NodeJS issue: https://github.com/nodejs/node/issues/52436