d3x0r / gun-db

sqlite storage adapter for Gun database (javascript)
44 stars 3 forks source link

installation fails #2

Closed davidm-public closed 4 years ago

davidm-public commented 6 years ago
$ npm i gun-db

> sack.vfs@0.1.99321 install /Users/davem/Auctionologies/repository/AuctionSoftware/au-2016/experiments/reactive/gun/gun-db-1/node_modules/sack.vfs
> node-gyp configure build

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  CXX(target) Release/obj.target/sack_vfs/src/vfs_module.o
  CXX(target) Release/obj.target/sack_vfs/src/sack/sack.o
In file included from ../src/sack/sack.cc:21126:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/limits:112:
/Library/Developer/CommandLineTools/usr/include/c++/v1/__undef_min_max:17:2: warning: : macro min is
      incompatible with C++. #undefing min [-W#warnings]
#warning: macro min is incompatible with C++.  #undefing min
 ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/__undef_min_max:29:2: warning: : macro max is
      incompatible with C++. #undefing max [-W#warnings]
#warning: macro max is incompatible with C++.  #undefing max
 ^
../src/sack/sack.cc:34964:15: warning: unknown pragma ignored [-Wunknown-pragmas]
#  pragma GCC push_options
              ^
../src/sack/sack.cc:34965:15: warning: unknown pragma ignored [-Wunknown-pragmas]
#  pragma GCC optimize ("O0")
              ^
../src/sack/sack.cc:35032:15: warning: unknown pragma ignored [-Wunknown-pragmas]
#  pragma GCC pop_options
              ^
../src/sack/sack.cc:59227:75: error: too few arguments provided to function-like macro invocation
                        EV_SET64( &ev, pc->Socket, EVFILT_READ, EV_DELETE, 0, 0, (uintptr_t)pc );
                                                                                               ^
/usr/include/sys/event.h:119:9: note: macro 'EV_SET64' defined here
#define EV_SET64(kevp, a, b, c, d, e, f, g, h) do {     \
        ^
../src/sack/sack.cc:59227:4: error: use of undeclared identifier 'EV_SET64'
                        EV_SET64( &ev, pc->Socket, EVFILT_READ, EV_DELETE, 0, 0, (uintptr_t)pc );
                        ^
../src/sack/sack.cc:59229:76: error: too few arguments provided to function-like macro invocation
                        EV_SET64( &ev, pc->Socket, EVFILT_WRITE, EV_DELETE, 0, 0, (uintptr_t)pc );
                                                                                                ^
/usr/include/sys/event.h:119:9: note: macro 'EV_SET64' defined here
#define EV_SET64(kevp, a, b, c, d, e, f, g, h) do {     \
        ^
../src/sack/sack.cc:59228:14: error: use of undeclared identifier 'peer'
                        kevent64( peer->kqueue, &ev, 1, 0, 0, 0, 0 );
                                  ^
../src/sack/sack.cc:59229:4: error: use of undeclared identifier 'EV_SET64'
                        EV_SET64( &ev, pc->Socket, EVFILT_WRITE, EV_DELETE, 0, 0, (uintptr_t)pc );
                        ^
../src/sack/sack.cc:59230:14: error: use of undeclared identifier 'peer'
                        kevent64( peer->kqueue, &ev, 1, 0, 0, 0, 0 );
                                  ^
../src/sack/sack.cc:59426:9: error: no matching function for call to 'kevent64'
                cnt = kevent64( thread->kqueue, NULL, 0, &events, 10, 0, NULL );
                      ^~~~~~~~
/usr/include/sys/event.h:386:9: note: candidate function not viable: no known conversion from
      'kevent64_s (*)[10]' to 'struct kevent64_s *' for 4th argument; remove &
int     kevent64(int kq,
        ^
../src/sack/sack.cc:59457:5: error: use of undeclared identifier 'pc'
                                pc = (PCLIENT)events[n].udata;
                                ^
../src/sack/sack.cc:59732:15: error: no member named 'kevents' in 'sack::network::peer_thread_info'
                this_thread.kevents = CreateDataList( sizeof( ev ) );
                ~~~~~~~~~~~ ^
../src/sack/sack.cc:84672:3: warning: variable 'n' is incremented both in the loop header and in the loop
      body [-Wfor-loop-analysis]
                n++;
                ^
../src/sack/sack.cc:84656:23: note: incremented here
        for( n = 0; blob[n]; n++ )
                             ^
6 warnings and 9 errors generated.
make: *** [Release/obj.target/sack_vfs/src/sack/sack.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/davem/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/Users/davem/.nvm/versions/node/v8.9.1/bin/node" "/Users/davem/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/davem/Auctionologies/repository/AuctionSoftware/au-2016/experiments/reactive/gun/gun-db-1/node_modules/sack.vfs
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN gun-db-1@1.0.0 No description
npm WARN gun-db-1@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sack.vfs@0.1.99321 install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sack.vfs@0.1.99321 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
d3x0r commented 6 years ago

Pushed and published fixes for that (I think). Had a lot of pending changes also, so it is possible different errors have appeared.

d3x0r commented 6 years ago

Got it to build for mac; but it segfaults... I don't have any way to debug that at this time. I tried to setup a mac VM but apple makes that really hard, maybe I'll look into that again later.

davidm-public commented 6 years ago

still failing:

$ npm i gun-db    

> sack.vfs@0.1.99322 install /Users/davem/Auctionologies/repository/AuctionSoftware/au-2016/experiments/reactive/gun/gun-db-1/node_modules/sack.vfs
> node-gyp configure build

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  CXX(target) Release/obj.target/sack_vfs/src/vfs_module.o
  CXX(target) Release/obj.target/sack_vfs/src/sack/sack.o
In file included from ../src/sack/sack.cc:21184:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/limits:112:
/Library/Developer/CommandLineTools/usr/include/c++/v1/__undef_min_max:17:2: warning: : macro min is incompatible with C++. #undefing min [-W#warnings]
#warning: macro min is incompatible with C++.  #undefing min
 ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/__undef_min_max:29:2: warning: : macro max is incompatible with C++. #undefing max [-W#warnings]
#warning: macro max is incompatible with C++.  #undefing max
 ^
../src/sack/sack.cc:35022:15: warning: unknown pragma ignored [-Wunknown-pragmas]
#  pragma GCC push_options
              ^
../src/sack/sack.cc:35023:15: warning: unknown pragma ignored [-Wunknown-pragmas]
#  pragma GCC optimize ("O0")
              ^
../src/sack/sack.cc:35090:15: warning: unknown pragma ignored [-Wunknown-pragmas]
#  pragma GCC pop_options
              ^
../src/sack/sack.cc:49844:4: error: use of undeclared identifier 'GetPrivateProfileString'; did you mean
      'sack::sql::options::Interface::option_interface_tag::_GetPrivateProfileString'?
          GetPrivateProfileString( WIDE("COM PORTS"), szPort, WIDE(""), szInit, sizeof( szInit ), WIDE("comports.ini") );
          ^~~~~~~~~~~~~~~~~~~~~~~
          sack::sql::options::Interface::option_interface_tag::_GetPrivateProfileString
../src/sack/sack.cc:10086:2: note: 'sack::sql::options::Interface::option_interface_tag::_GetPrivateProfileString' declared here
        METHOD_PTR( size_t, GetPrivateProfileString )( CTEXTSTR pSection, CTEXTSTR pOptname, CTEXTSTR pDefaultbuf, TEXTSTR pBuffer, size_t nBuffer, CTEXTSTR pININame );
        ^
../src/sack/sack.cc:8287:44: note: expanded from macro 'METHOD_PTR'
#define METHOD_PTR(type,name) type (CPROC *_##name)
                                           ^
<scratch space>:93:1: note: expanded from here
_GetPrivateProfileString
^
../src/sack/sack.cc:49844:4: error: invalid use of non-static data member '_GetPrivateProfileString'
          GetPrivateProfileString( WIDE("COM PORTS"), szPort, WIDE(""), szInit, sizeof( szInit ), WIDE("comports.ini") );
          ^~~~~~~~~~~~~~~~~~~~~~~
../src/sack/sack.cc:49846:6: error: use of undeclared identifier 'WritePrivateProfileString'; did you mean
      'sack::sql::options::Interface::option_interface_tag::_WritePrivateProfileString'?
                          WritePrivateProfileString( WIDE("COM PORTS"), szPort, WIDE("57600,N,8,1,cARRIER,RTS,rTSFLOW"), WIDE("comports.ini") );
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
                          sack::sql::options::Interface::option_interface_tag::_WritePrivateProfileString
../src/sack/sack.cc:10091:2: note: 'sack::sql::options::Interface::option_interface_tag::_WritePrivateProfileString' declared here
        METHOD_PTR( LOGICAL, WritePrivateProfileString )( CTEXTSTR pSection, CTEXTSTR pName, CTEXTSTR pValue, CTEXTSTR pINIFile );
        ^
../src/sack/sack.cc:8287:44: note: expanded from macro 'METHOD_PTR'
#define METHOD_PTR(type,name) type (CPROC *_##name)
                                           ^
<scratch space>:97:1: note: expanded from here
_WritePrivateProfileString
^
../src/sack/sack.cc:49846:6: error: invalid use of non-static data member '_WritePrivateProfileString'
                          WritePrivateProfileString( WIDE("COM PORTS"), szPort, WIDE("57600,N,8,1,cARRIER,RTS,rTSFLOW"), WIDE("comports.ini") );
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/sack/sack.cc:57814:4: error: unknown type name 'PDATLIST'; did you mean 'PDATALIST'?
   PDATLIST kevents;
   ^~~~~~~~
   PDATALIST
../src/sack/sack.cc:1514:27: note: 'PDATALIST' declared here
typedef struct DataBlock *PDATALIST;
                          ^
5 warnings and 5 errors generated.
make: *** [Release/obj.target/sack_vfs/src/sack/sack.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/davem/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/Users/davem/.nvm/versions/node/v8.9.1/bin/node" "/Users/davem/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/davem/Auctionologies/repository/AuctionSoftware/au-2016/experiments/reactive/gun/gun-db-1/node_modules/sack.vfs
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN gun-db-1@1.0.0 No description
npm WARN gun-db-1@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sack.vfs@0.1.99322 install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sack.vfs@0.1.99322 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/davem/.npm/_logs/2017-12-23T15_46_47_824Z-debug.log
d3x0r commented 6 years ago

Well I didn't publish a new version to npm because it segfaults even if it does compile correctly. Sorry; again I don't have a mac to debug it.

d3x0r commented 6 years ago

Got a mac; was able to debug the segfault, and sqlite database basically works. I want to test gun-ws which uses the same sack.vfs module on the backend and will probably publish an update later today. (it's now 6:36am for me PST)

d3x0r commented 6 years ago

Okay; if you're still playin with this. Fixed sack.vfs so this should now work on mac. (also gun-ws which uses same backend) (published to npm) so npm update should work.

davidm-public commented 6 years ago

Seems to install, some warnings but no errors, haven't tried it out yet:

$ npm i gun-db

> sack.vfs@0.1.99324 install /Users/davem/Auctionologies/repository/AuctionSoftware/au-2016/experiments/reactive/gun/gun-exp-1/node_modules/sack.vfs
> node-gyp configure build

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  CXX(target) Release/obj.target/sack_vfs/src/vfs_module.o
  CXX(target) Release/obj.target/sack_vfs/src/sack/sack.o
In file included from ../src/sack/sack.cc:16862:
In file included from /System/Library/Frameworks/Security.framework/Headers/Security.h:32:
In file included from /System/Library/Frameworks/Security.framework/Headers/SecKey.h:38:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:24:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:310:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/limits:112:
/Library/Developer/CommandLineTools/usr/include/c++/v1/__undef_min_max:17:2: warning: : macro min is
      incompatible with C++. #undefing min [-W#warnings]
#warning: macro min is incompatible with C++.  #undefing min
 ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/__undef_min_max:29:2: warning: : macro max is
      incompatible with C++. #undefing max [-W#warnings]
#warning: macro max is incompatible with C++.  #undefing max
 ^
../src/sack/sack.cc:35170:15: warning: unknown pragma ignored [-Wunknown-pragmas]
#  pragma GCC push_options
              ^
../src/sack/sack.cc:35171:15: warning: unknown pragma ignored [-Wunknown-pragmas]
#  pragma GCC optimize ("O0")
              ^
../src/sack/sack.cc:35238:15: warning: unknown pragma ignored [-Wunknown-pragmas]
#  pragma GCC pop_options
              ^
5 warnings generated.
  CC(target) Release/obj.target/sack_vfs/src/sack/sqlite3.o
  CXX(target) Release/obj.target/sack_vfs/src/com_interface.o
  CXX(target) Release/obj.target/sack_vfs/src/sql_module.o
  CXX(target) Release/obj.target/sack_vfs/src/thread_module.o
  CXX(target) Release/obj.target/sack_vfs/src/jsonParse.o
  CXX(target) Release/obj.target/sack_vfs/src/tls_interface.o
  CXX(target) Release/obj.target/sack_vfs/src/srg_module.o
  CXX(target) Release/obj.target/sack_vfs/src/websocket_module.o
  CXX(target) Release/obj.target/sack_vfs/src/network_module.o
  SOLINK_MODULE(target) Release/sack_vfs.node
npm WARN gun-exp-1@1.0.0 No description
npm WARN gun-exp-1@1.0.0 No repository field.

+ gun-db@1.0.568
added 22 packages in 50.336s
d3x0r commented 6 years ago

5 by 5.