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

upgrade better-sqlite3 #13

Open
2 tasks done
james-lawrence opened this issue Sep 12, 2024 · 3 comments
Open
2 tasks done

upgrade better-sqlite3 #13

james-lawrence opened this issue Sep 12, 2024 · 3 comments

Comments

@james-lawrence
Copy link

Describe the issue that you're seeing. Any Loom videos or screenshots usually help a lot!

any chance sqlite-level could upgrade to a version of better-sqlite3 (ideally the latest). the current version in this package of better-sqlite3's has node-gyp pinned to a old version that fails to build on newer systems. they removed this pin right before the 9.0.0 release on october 10th 2023.

Reproduction

n/a

Steps to reproduce

No response

System Info

n/a

Validations

@james-lawrence james-lawrence added the bug Something isn't working label Sep 12, 2024
@kldavis4 kldavis4 added enhancement New feature or request and removed bug Something isn't working enhancement New feature or request labels Sep 15, 2024
@kldavis4
Copy link
Member

I believe we ran into issues in the past which prevented using a newer version. Will chat w/ @wicksipedia about whether this is something we can tackle at the moment.

can you provide more details about the errors you are encountering?

@james-lawrence
Copy link
Author

james-lawrence commented Sep 15, 2024

Likely we can close this, issue seemed related to the version of nodejs (22) and issues with node-gyp symbols. it'd likely still be resolved long term by updating the dependency.

@witem
Copy link

witem commented Sep 18, 2024

I have similar problems. npm logs:

npm error code 1
npm error path /home/runner/work/anna-website/anna-website/node_modules/better-sqlite3
npm error command failed
npm error command sh -c prebuild-install || node-gyp rebuild --release
npm error make: Entering directory '/home/runner/work/anna-website/anna-website/node_modules/better-sqlite3/build'
npm error   TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error   ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error   TOUCH Release/obj.target/deps/locate_sqlite3.stamp
npm error   CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
npm error rm -f Release/obj.target/deps/sqlite3.a Release/obj.target/deps/sqlite3.a.ar-file-list; mkdir -p `dirname Release/obj.target/deps/sqlite3.a`
npm error ar crs Release/obj.target/deps/sqlite3.a @Release/obj.target/deps/sqlite3.a.ar-file-list
npm error   COPY Release/sqlite3.a
npm error   CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
npm error rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm error make: Leaving directory '/home/runner/work/anna-website/anna-website/node_modules/better-sqlite3/build'
npm error prebuild-install warn install No prebuilt binaries found (target=22.8.0 runtime=node arch=x64 libc= platform=linux)
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | linux | x64
npm error gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3"
npm error gyp http GET https://nodejs.org/download/release/v22.8.0/node-v22.8.0-headers.tar.gz
npm error gyp http 200 https://nodejs.org/download/release/v22.8.0/node-v22.8.0-headers.tar.gz
npm error gyp http GET https://nodejs.org/download/release/v22.8.0/SHASUMS256.txt
npm error gyp http 200 https://nodejs.org/download/release/v22.8.0/SHASUMS256.txt
npm error gyp info spawn /usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/opt/hostedtoolcache/node/22.8.0/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/home/runner/work/anna-website/anna-website/node_modules/better-sqlite3/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/opt/hostedtoolcache/node/22.8.0/x64/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/home/runner/.cache/node-gyp/22.8.0/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/home/runner/.cache/node-gyp/22.8.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/opt/hostedtoolcache/node/22.8.0/x64/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/home/runner/.cache/node-gyp/22.8.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/home/runner/work/anna-website/anna-website/node_modules/better-sqlite3',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error In file included from ./src/better_sqlite3.lzz:11,
npm error                  from ../src/better_sqlite3.cpp:4:
npm error /home/runner/.cache/node-gyp/22.8.0/include/node/node.h:1252:7: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>)’ to ‘node::addon_context_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>, void*)’} [-Wcast-function-type]
npm error  1252 |       (node::addon_context_register_func) (regfunc),                  \
npm error       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error /home/runner/.cache/node-gyp/22.8.0/include/node/node.h:1270:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE_X’
npm error  1270 |   NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0)
npm error       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error /home/runner/.cache/node-gyp/22.8.0/include/node/node.h:1301:3: note: in expansion of macro ‘NODE_MODULE_CONTEXT_AWARE’
npm error  1301 |   NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME,                     \
npm error       |   ^~~~~~~~~~~~~~~~~~~~~~~~~
npm error ./src/better_sqlite3.lzz:67:1: note: in expansion of macro ‘NODE_MODULE_INIT’
npm error ./src/util/macros.lzz: In function ‘void SetPrototypeGetter(v8::Isolate*, v8::Local<v8::External>, v8::Local<v8::FunctionTemplate>, const char*, v8::AccessorGetterCallback)’:
npm error ./src/util/macros.lzz:150:46: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, void (*&)(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&), int, v8::Local<v8::External>&, v8::AccessControl, v8::PropertyAttribute)’
npm error In file included from /home/runner/.cache/node-gyp/22.8.0/include/node/v8-function.h:15,
npm error                  from /home/runner/.cache/node-gyp/22.8.0/include/node/v8.h:33,
npm error                  from /home/runner/.cache/node-gyp/22.8.0/include/node/node.h:73,
npm error                  from ./src/better_sqlite3.lzz:11,
npm error                  from ../src/better_sqlite3.cpp:4:
npm error /home/runner/.cache/node-gyp/22.8.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm error  1049 |   void SetAccessor(
npm error       |        ^~~~~~~~~~~
npm error /home/runner/.cache/node-gyp/22.8.0/include/node/v8-template.h:1052:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
npm error  1052 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
npm error       |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
npm error /home/runner/.cache/node-gyp/22.8.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm error  1055 |   void SetAccessor(
npm error       |        ^~~~~~~~~~~
npm error /home/runner/.cache/node-gyp/22.8.0/include/node/v8-template.h:1058:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
npm error  1058 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
npm error       |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
npm error ./src/util/data.lzz: In function ‘v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_stmt*, int, bool)’:
npm error ./src/util/data.lzz:73:92: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm error ./src/util/data.lzz:73:197: note: here
npm error ./src/util/data.lzz: In function ‘v8::Local<v8::Value> Data::GetValueJS(v8::Isolate*, sqlite3_value*, bool)’:
npm error ./src/util/data.lzz:77:81: warning: this statement may fall through [-Wimplicit-fallthrough=]
npm error ./src/util/data.lzz:77:175: note: here
npm error make: *** [better_sqlite3.target.mk:122: Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
npm error gyp ERR! build error 
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/opt/hostedtoolcache/node/22.8.0/x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm error gyp ERR! System Linux 6.5.0-1025-azure
npm error gyp ERR! command "/opt/hostedtoolcache/node/22.8.0/x64/bin/node" "/opt/hostedtoolcache/node/22.8.0/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
npm error gyp ERR! cwd /home/runner/work/anna-website/anna-website/node_modules/better-sqlite3
npm error gyp ERR! node -v v22.8.0
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok

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