Level / classic-level

An abstract-level database backed by LevelDB.
MIT License
58 stars 12 forks source link

Build error? #15

Closed ronag closed 2 years ago

ronag commented 2 years ago

Trying to build fails with missing snappy header.

classic-level$ npm i

> classic-level@1.2.0 install
> node-gyp-build

gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@17.8.0 | darwin | arm64
gyp info find Python using Python version 3.9.10 found at "/opt/homebrew/opt/python@3.9/bin/python3.9"
gyp info spawn /opt/homebrew/opt/python@3.9/bin/python3.9
gyp info spawn args [
gyp info spawn args   '/Users/ronagy/GitHub/classic-level/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/ronagy/GitHub/classic-level/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/ronagy/GitHub/classic-level/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/ronagy/Library/Caches/node-gyp/17.8.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/ronagy/Library/Caches/node-gyp/17.8.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/ronagy/GitHub/classic-level/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/ronagy/Library/Caches/node-gyp/17.8.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/ronagy/GitHub/classic-level',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o
In file included from ../deps/leveldb/leveldb-1.20/db/builder.cc:7:
In file included from ../deps/leveldb/leveldb-1.20/db/filename.h:14:
In file included from ../deps/leveldb/leveldb-1.20/port/port.h:16:
../deps/leveldb/leveldb-1.20/port/port_posix.h:43:10: fatal error: 'snappy.h' file not found
#include <snappy.h>
         ^~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/ronagy/GitHub/classic-level/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.3.0
gyp ERR! command "/Users/ronagy/.nvm/versions/node/v17.8.0/bin/node" "/Users/ronagy/GitHub/classic-level/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/ronagy/GitHub/classic-level
gyp ERR! node -v v17.8.0
gyp ERR! node-gyp -v v9.0.0
gyp ERR! not ok 
npm ERR! code 1
npm ERR! path /Users/ronagy/GitHub/classic-level
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
vweevers commented 2 years ago

At quick glance I'd say that's a missing submodule. See https://github.com/Level/classic-level#development