xdenser / node-firebird-libfbclient

Firebird SQL binding
MIT License
82 stars 34 forks source link

Problems installing inside docker container #130

Closed tautf closed 1 year ago

tautf commented 1 year ago

Hey again,

trying to install this package inside a clean contaniner node:16 returns:

npm install
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm ERR! code 1
npm ERR! path /drone/src/backend/node_modules/firebird
npm ERR! command failed
npm ERR! command sh -c -- node-gyp rebuild
npm ERR! make: Entering directory '/drone/src/backend/node_modules/firebird/build'
npm ERR!   CXX(target) Release/obj.target/binding/src/fb-bindings.o
npm ERR!   CXX(target) Release/obj.target/binding/src/fb-bindings-blob.o
npm ERR!   CXX(target) Release/obj.target/binding/src/fb-bindings-fbresult.o
npm ERR!   CXX(target) Release/obj.target/binding/src/fb-bindings-connection.o
npm ERR!   CXX(target) Release/obj.target/binding/src/fb-bindings-eventblock.o
npm ERR!   CXX(target) Release/obj.target/binding/src/fb-bindings-fbeventemitter.o
npm ERR!   CXX(target) Release/obj.target/binding/src/fb-bindings-statement.o
npm ERR!   CXX(target) Release/obj.target/binding/src/fb-bindings-transaction.o
npm ERR!   SOLINK_MODULE(target) Release/obj.target/binding.node
npm ERR! make: Leaving directory '/drone/src/backend/node_modules/firebird/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@16.18.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.18.0/node-v16.18.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.18.0/node-v16.18.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v16.18.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.18.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/drone/src/backend/node_modules/firebird/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/root/.cache/node-gyp/16.18.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/16.18.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/16.18.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/drone/src/backend/node_modules/firebird',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../../nan/nan.h:58,
npm ERR!                  from ../src/././fb-bindings.h:11,
npm ERR!                  from ../src/./fb-bindings-connection.h:17,
npm ERR!                  from ../src/fb-bindings.cc:14:
npm ERR! /root/.cache/node-gyp/16.18.0/include/node/node.h:887:43: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>)' to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
npm ERR!        (node::addon_register_func) (regfunc),                          \
npm ERR!                                            ^
npm ERR! /root/.cache/node-gyp/16.18.0/include/node/node.h:921:3: note: in expansion of macro 'NODE_MODULE_X'
npm ERR!    NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!    ^~~~~~~~~~~~~
npm ERR! ../src/fb-bindings.cc:57:1: note: in expansion of macro 'NODE_MODULE'
npm ERR!  NODE_MODULE(binding, init)
npm ERR!  ^~~~~~~~~~~
npm ERR! ../src/fb-bindings-blob.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE FBblob::Read(Nan::NAN_METHOD_ARGS_TYPE)':
npm ERR! ../src/fb-bindings-blob.cc:201:72: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
npm ERR!      uv_queue_work(uv_default_loop(), req, EIO_Read,  (uv_after_work_cb)EIO_After_Read);
npm ERR!                                                                         ^~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-blob.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE FBblob::Write(Nan::NAN_METHOD_ARGS_TYPE)':
npm ERR! ../src/fb-bindings-blob.cc:368:73: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
npm ERR!      uv_queue_work(uv_default_loop(), req, EIO_Write,  (uv_after_work_cb)EIO_After_Write);
npm ERR!                                                                          ^~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-fbresult.cc: In static member function 'static void FBResult::EIO_After_Fetch(uv_work_t*)':
npm ERR! ../src/fb-bindings-fbresult.cc:747:85: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
npm ERR!                  uv_queue_work(uv_default_loop(), req, EIO_Fetch,  (uv_after_work_cb)EIO_After_Fetch);
npm ERR!                                                                                      ^~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-fbresult.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE FBResult::Fetch(Nan::NAN_METHOD_ARGS_TYPE)':
npm ERR! ../src/fb-bindings-fbresult.cc:854:73: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
npm ERR!      uv_queue_work(uv_default_loop(), req, EIO_Fetch,  (uv_after_work_cb)EIO_After_Fetch);
npm ERR!                                                                          ^~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-fbresult.cc: In member function 'void FBResult::releaseStatement()':
npm ERR! ../src/fb-bindings-fbresult.cc:884:17: warning: converting to non-pointer type 'isc_stmt_handle' {aka 'unsigned int'} from NULL [-Wconversion-null]
npm ERR!      else stmt = NULL;
npm ERR!                  ^~~~
npm ERR! ../src/fb-bindings-fbresult.cc: In static member function 'static void FBResult::set_params(XSQLDA*, Nan::NAN_METHOD_ARGS_TYPE, int)':
npm ERR! ../src/fb-bindings-fbresult.cc:279:36: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
npm ERR!                              strncpy(var->sqldata, *txt, s_len);
npm ERR!                              ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-fbresult.cc:277:53: note: length computed here
npm ERR!                              s_len = (int16_t) strlen(*txt);
npm ERR!                                                ~~~~~~^~~~~~
npm ERR! ../src/fb-bindings-connection.cc: In member function 'bool Connection::Close()':
npm ERR! ../src/fb-bindings-connection.cc:113:12: warning: converting to non-pointer type 'isc_db_handle' {aka 'unsigned int'} from NULL [-Wconversion-null]
npm ERR!        db = NULL;
npm ERR!             ^~~~
npm ERR! ../src/fb-bindings-connection.cc:116:10: warning: converting to non-pointer type 'isc_db_handle' {aka 'unsigned int'} from NULL [-Wconversion-null]
npm ERR!      db = NULL;
npm ERR!           ^~~~
npm ERR! ../src/fb-bindings-connection.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE Connection::Connect(Nan::NAN_METHOD_ARGS_TYPE)':
npm ERR! ../src/fb-bindings-connection.cc:514:75: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
npm ERR!      uv_queue_work(uv_default_loop(), req, EIO_Connect,  (uv_after_work_cb)EIO_After_Connect);
npm ERR!                                                                            ^~~~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-connection.cc: In member function 'void Connection::InstQuerySync(const Nan::FunctionCallbackInfo<v8::Value>&, Transaction*)':
npm ERR! ../src/fb-bindings-connection.cc:649:28: warning: converting to non-pointer type 'isc_stmt_handle' {aka 'unsigned int'} from NULL [-Wconversion-null]
npm ERR!      isc_stmt_handle stmt = NULL;
npm ERR!                             ^~~~
npm ERR! ../src/fb-bindings-connection.cc: In member function 'void Connection::InstQuery(const Nan::FunctionCallbackInfo<v8::Value>&, Transaction*)':
npm ERR! ../src/fb-bindings-connection.cc:788:19: warning: converting to non-pointer type 'isc_stmt_handle' {aka 'unsigned int'} from NULL [-Wconversion-null]
npm ERR!      q_req->stmt = NULL;
npm ERR!                    ^~~~
npm ERR! ../src/fb-bindings-connection.cc:795:73: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
npm ERR!      uv_queue_work(uv_default_loop(), req, EIO_Query,  (uv_after_work_cb)EIO_After_Query);
npm ERR!                                                                          ^~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-connection.cc: In member function 'void Connection::InstPrepareSync(const Nan::FunctionCallbackInfo<v8::Value>&, Transaction*)':
npm ERR! ../src/fb-bindings-connection.cc:853:28: warning: converting to non-pointer type 'isc_stmt_handle' {aka 'unsigned int'} from NULL [-Wconversion-null]
npm ERR!      isc_stmt_handle stmt = NULL;
npm ERR!                             ^~~~
npm ERR! ../src/fb-bindings-connection.cc: In constructor 'Connection::Connection()':
npm ERR! ../src/fb-bindings-connection.cc:897:10: warning: converting to non-pointer type 'isc_db_handle' {aka 'unsigned int'} from NULL [-Wconversion-null]
npm ERR!      db = NULL;
npm ERR!           ^~~~
npm ERR! ../src/fb-bindings-connection.cc: In destructor 'virtual Connection::~Connection()':
npm ERR! ../src/fb-bindings-connection.cc:906:9: warning: NULL used in arithmetic [-Wpointer-arith]
npm ERR!   if(db!=NULL) Close();
npm ERR!          ^~~~
npm ERR! ../src/fb-bindings-connection.cc:911:5: warning: NULL used in arithmetic [-Wpointer-arith]
npm ERR!      assert(db == NULL);
npm ERR!      ^~~~~~
npm ERR! In function 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)',
npm ERR!     inlined from 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)' at ../src/fb-bindings-connection.cc:50:6:
npm ERR! ../src/fb-bindings-connection.cc:65:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
npm ERR!      strncpy(&(dpb[i]), User, len);
npm ERR!      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-connection.cc: In member function 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)':
npm ERR! ../src/fb-bindings-connection.cc:60:26: note: length computed here
npm ERR!      len = (short) strlen (User);
npm ERR!                    ~~~~~~~^~~~~~
npm ERR! In function 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)',
npm ERR!     inlined from 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)' at ../src/fb-bindings-connection.cc:50:6:
npm ERR! ../src/fb-bindings-connection.cc:74:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
npm ERR!      strncpy(&(dpb[i]), Password, len);
npm ERR!      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-connection.cc: In member function 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)':
npm ERR! ../src/fb-bindings-connection.cc:69:26: note: length computed here
npm ERR!      len = (short) strlen (Password);
npm ERR!                    ~~~~~~~^~~~~~~~~~
npm ERR! In function 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)',
npm ERR!     inlined from 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)' at ../src/fb-bindings-connection.cc:50:6:
npm ERR! ../src/fb-bindings-connection.cc:83:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
npm ERR!      strncpy(&(dpb[i]), Role, len);
npm ERR!      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-connection.cc: In member function 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)':
npm ERR! ../src/fb-bindings-connection.cc:78:26: note: length computed here
npm ERR!      len = (short) strlen (Role);
npm ERR!                    ~~~~~~~^~~~~~
npm ERR! In function 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)',
npm ERR!     inlined from 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)' at ../src/fb-bindings-connection.cc:50:6:
npm ERR! ../src/fb-bindings-connection.cc:89:9: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
npm ERR!   strncpy(&(dpb[i]), lc_type, len);
npm ERR!   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-connection.cc: In member function 'bool Connection::Connect(const char*, const char*, const char*, const char*, const char*)':
npm ERR! ../src/fb-bindings-connection.cc:87:23: note: length computed here
npm ERR!   len = (short) strlen (lc_type);
npm ERR!                 ~~~~~~~^~~~~~~~~
npm ERR! ../src/fb-bindings-statement.cc: In member function 'void FBStatement::InstExec(const Nan::FunctionCallbackInfo<v8::Value>&, Transaction*, int)':
npm ERR! ../src/fb-bindings-statement.cc:224:72: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
npm ERR!      uv_queue_work(uv_default_loop(), req, EIO_Exec,  (uv_after_work_cb)EIO_After_Exec);
npm ERR!                                                                         ^~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-transaction.cc: In member function 'void Transaction::makeTrRequest(const Nan::FunctionCallbackInfo<v8::Value>&, Transaction::TransReqType)':
npm ERR! ../src/fb-bindings-transaction.cc:160:82: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
npm ERR!   uv_queue_work(uv_default_loop(), req, EIO_TransactionRequest, (uv_after_work_cb)EIO_After_TransactionRequest);
npm ERR!                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/fb-bindings-transaction.cc: In constructor 'Transaction::Transaction(Connection*)':
npm ERR! ../src/fb-bindings-transaction.cc:210:10: warning: converting to non-pointer type 'isc_tr_handle' {aka 'unsigned int'} from NULL [-Wconversion-null]
npm ERR!   trans = NULL;
npm ERR!           ^~~~
npm ERR! /usr/bin/ld: cannot find -lfbclient
npm ERR! collect2: error: ld returned 1 exit status
npm ERR! make: *** [binding.target.mk:151: Release/obj.target/binding.node] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Linux 5.4.0-42-generic
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /drone/src/backend/node_modules/firebird
npm ERR! gyp ERR! node -v v16.18.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

Installation on the host itself works properly. Anybody has experience with this, do i need to have a different node container? I installed firebird and firebird-dev on the host. Host is linux.

mariuz commented 1 year ago

you might need firebird client lib https://packages.debian.org/sid/libfbclient2

tautf commented 1 year ago

you might need firebird client lib https://packages.debian.org/sid/libfbclient2

Is already installed on the host system.

tautf commented 1 year ago

I fixed it by making my own docker images with nodejs and firebird installed:

# syntax=docker/dockerfile:1
FROM ubuntu:20.04
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y apt-transport-https ca-certificates
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y firebird3.0-server firebird-dev libfbclient2 curl git make g++ python3
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs build-essential