Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install @ngageoint/geopackage on Docker node:17 #180

Open
sbancal opened this issue Feb 24, 2022 · 4 comments
Open

Install @ngageoint/geopackage on Docker node:17 #180

sbancal opened this issue Feb 24, 2022 · 4 comments

Comments

@sbancal
Copy link

sbancal commented Feb 24, 2022

Hi,
Trying, with no success, to install @ngageoint/leaflet-geopackage in node:17 Docker container.

Here are the steps to reproduce :

docker run --rm -it node:17 /bin/bash
cd /root
apt-get update && apt-get install -y libpangocairo-1.0-0 libpango1.0-dev
npm install @ngageoint/geopackage

Error output gives :

1414 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "@ngageoint/geopackage"
1415 verbose node v17.5.0
1416 verbose npm  v8.4.1
1417 error code 1
1418 error path /root/node_modules/better-sqlite3
1419 error command failed
1420 error command sh -c prebuild-install || npm run build-release
1421 error > [email protected] build-release
1421 error > node-gyp rebuild --release
1421 error
1421 error make: Entering directory '/root/node_modules/better-sqlite3/build'
1421 error   TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
1421 error   ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
1421 error   TOUCH Release/obj.target/deps/locate_sqlite3.stamp
1421 error   CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
1421 error   AR(target) Release/obj.target/deps/sqlite3.a
1421 error   COPY Release/sqlite3.a
1421 error   CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
1421 error rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
1421 error make: Leaving directory '/root/node_modules/better-sqlite3/build'
1422 error gyp info it worked if it ends with ok
1422 error gyp info using [email protected]
1422 error gyp info using [email protected] | linux | x64
1422 error gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
1422 error gyp http GET https://nodejs.org/download/release/v17.5.0/node-v17.5.0-headers.tar.gz
1422 error gyp http 200 https://nodejs.org/download/release/v17.5.0/node-v17.5.0-headers.tar.gz
1422 error gyp http GET https://nodejs.org/download/release/v17.5.0/SHASUMS256.txt
1422 error gyp http 200 https://nodejs.org/download/release/v17.5.0/SHASUMS256.txt
1422 error gyp info spawn /usr/bin/python3
1422 error gyp info spawn args [
1422 error gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
1422 error gyp info spawn args   'binding.gyp',
1422 error gyp info spawn args   '-f',
1422 error gyp info spawn args   'make',
1422 error gyp info spawn args   '-I',
1422 error gyp info spawn args   '/root/node_modules/better-sqlite3/build/config.gypi',
1422 error gyp info spawn args   '-I',
1422 error gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
1422 error gyp info spawn args   '-I',
1422 error gyp info spawn args   '/root/.cache/node-gyp/17.5.0/include/node/common.gypi',
1422 error gyp info spawn args   '-Dlibrary=shared_library',
1422 error gyp info spawn args   '-Dvisibility=default',
1422 error gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/17.5.0',
1422 error gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
1422 error gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/17.5.0/<(target_arch)/node.lib',
1422 error gyp info spawn args   '-Dmodule_root_dir=/root/node_modules/better-sqlite3',
1422 error gyp info spawn args   '-Dnode_engine=v8',
1422 error gyp info spawn args   '--depth=.',
1422 error gyp info spawn args   '--no-parallel',
1422 error gyp info spawn args   '--generator-output',
1422 error gyp info spawn args   'build',
1422 error gyp info spawn args   '-Goutput_dir=.'
1422 error gyp info spawn args ]
1422 error gyp info spawn make
1422 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
1422 error Release/obj/gen/sqlite3/sqlite3.c: In function 'sqlite3SelectNew':
1422 error Release/obj/gen/sqlite3/sqlite3.c:128048:10: warning: function may return address of local variable [-Wreturn-local-addr]
1422 error 128048 |   return pNew;
1422 error        |          ^~~~
1422 error Release/obj/gen/sqlite3/sqlite3.c:128008:10: note: declared here
1422 error 128008 |   Select standin;
1422 error        |          ^~~~~~~
1422 error Release/obj/gen/sqlite3/sqlite3.c:128008:10: note: declared here
1422 error In file included from ./src/better_sqlite3.lzz:10,
1422 error                  from ../src/better_sqlite3.cpp:4:
1422 error /root/.cache/node-gyp/17.5.0/include/node/node.h:843:7: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Object>)' to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
1422 error   843 |       (node::addon_register_func) (regfunc),                          \
1422 error       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1422 error /root/.cache/node-gyp/17.5.0/include/node/node.h:877:3: note: in expansion of macro 'NODE_MODULE_X'
1422 error   877 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
1422 error       |   ^~~~~~~~~~~~~
1422 error ./src/better_sqlite3.lzz:15:1: note: in expansion of macro 'NODE_MODULE'
1422 error ./src/objects/database.lzz: In static member function 'static void Database::Init(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Object>)':
1422 error ./src/objects/database.lzz:129:40: error: cannot convert 'void (*)(void*)' to 'node::Environment*'
1422 error In file included from ./src/better_sqlite3.lzz:10,
1422 error                  from ../src/better_sqlite3.cpp:4:
1422 error /root/.cache/node-gyp/17.5.0/include/node/node.h:935:38: note:   initializing argument 1 of 'void node::AtExit(node::Environment*, void (*)(void*), void*)'
1422 error   935 | NODE_EXTERN void AtExit(Environment* env,
1422 error       |                         ~~~~~~~~~~~~~^~~
1422 error ./src/util/binder.lzz: In static member function 'static bool Binder::IsPlainObject(v8::Isolate*, v8::Local<v8::Object>)':
1422 error ./src/util/binder.lzz:36:67: warning: 'v8::Local<v8::Context> v8::Object::CreationContext()' is deprecated: Use MaybeLocal<Context> GetCreationContext() [-Wdeprecated-declarations]
1422 error In file included from /root/.cache/node-gyp/17.5.0/include/node/v8-array-buffer.h:13,
1422 error                  from /root/.cache/node-gyp/17.5.0/include/node/v8.h:25,
1422 error                  from /root/.cache/node-gyp/17.5.0/include/node/node.h:63,
1422 error                  from ./src/better_sqlite3.lzz:10,
1422 error                  from ../src/better_sqlite3.cpp:4:
1422 error /root/.cache/node-gyp/17.5.0/include/node/v8-object.h:598:18: note: declared here
1422 error   598 |   Local<Context> CreationContext();
1422 error       |                  ^~~~~~~~~~~~~~~
1422 error make: *** [better_sqlite3.target.mk:125: Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
1422 error gyp ERR! build error 
1422 error gyp ERR! stack Error: `make` failed with exit code: 2
1422 error gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
1422 error gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
1422 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
1422 error gyp ERR! System Linux 5.14.0-1024-oem
1422 error gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
1422 error gyp ERR! cwd /root/node_modules/better-sqlite3
1422 error gyp ERR! node -v v17.5.0
1422 error gyp ERR! node-gyp -v v8.4.1
1422 error gyp ERR! not ok
1423 verbose exit 1
1424 timing npm Completed in 43987ms
1425 verbose unfinished npm timer reify 1645694903011
1426 verbose unfinished npm timer reify:build 1645694908318
1427 verbose unfinished npm timer build 1645694908319
1428 verbose unfinished npm timer build:deps 1645694908319
1429 verbose unfinished npm timer build:run:install 1645694908338
1430 verbose unfinished npm timer build:run:install:node_modules/better-sqlite3 1645694908339
1431 verbose code 1

There is probably a dependency missing ... I tried several sqlite packages : apt-get install -y libaprutil1-dbd-sqlite3 libgom-1.0-0 libqt5sql5-sqlite libspatialite-dev libspatialite7 libsqlite3-0 libsqlite3-dev ruby-sqlite3 sqlite3 ... but with no success.

Thanks for any advice on this,
regards

@sbancal sbancal changed the title Install @ngageoint/leaflet-geopackage on Docker node:17 Install @ngageoint/geopackage on Docker node:17 Feb 24, 2022
@sbancal
Copy link
Author

sbancal commented Feb 24, 2022

More on what I've found ...
It's about a dependency : [email protected].
When I try to install [email protected] manually, it fails.
On the other hand when I install its latest version, it works perfect :

npm install better-sqlite3

Would it be possible to upgrade geopackage's dependency to newer version of better-sqlite3 ? "^7.5.0" ?

@danielbarela
Copy link
Member

Yes it is possible, in a way. Leaflet-geopackage depends on the main geopackage project. Version 4.1.0-beta.1 has upgraded the better-sqlite package to a newer version, however leaflet-geopackage has not been updated to have 4.1.0-beta.1 as a dependency. We are working towards getting 4.1 released as a non beta version soon, and will update leaflet-geopackage following that. If you would like to upgrade leaflet-geopackage to update the @ngageoint/geopackage dependency to 4.1.0-beta.1 and issue a pull request, I can publish it.

@sbancal
Copy link
Author

sbancal commented Feb 24, 2022

Thanks for your answer.
Looking forward for that update, in the time that is yours.
regards

@caldwellc
Copy link
Collaborator

caldwellc commented May 6, 2022

@sbancal leaflet-geopackage (v4.1.1) has now been updated to use the latest @ngageoint/geopackage (v4.1.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants