yfinkelstein / node-zookeeper

node.js client for Apache Zookeeper
MIT License
479 stars 111 forks source link

Doesn't compile on node22 (current) #343

Closed Stono closed 5 months ago

Stono commented 5 months ago

Describe the bug Was just trying to upgrade a few of my apps to node 22, and couldn't do one because zookeeper doesn't compile.

Desktop (please complete the following information):

Additional context

3030 info run zookeeper@6.1.1 install { code: 1, signal: null }
3031 verbose stack Error: command failed
3031 verbose stack     at ChildProcess.<anonymous> (/Users/karl.stoney/.nvm/versions/node/v22.2.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
3031 verbose stack     at ChildProcess.emit (node:events:520:28)
3031 verbose stack     at maybeClose (node:internal/child_process:1105:16)
3031 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
3032 verbose pkgid zookeeper@6.1.1
3033 verbose cwd /Users/karl.stoney/git/autotrader/solr-overwatch
3034 verbose Darwin 23.3.0
3035 verbose node v22.2.0
3036 verbose npm  v10.7.0
3037 error code 1
3038 error path /Users/karl.stoney/git/autotrader/solr-overwatch/node_modules/zookeeper
3039 error command failed
3040 error command sh -c node ./scripts/prepublish.js && npm run build
3041 error Decompressed file
3041 error
3041 error > zookeeper@6.1.1 build
3041 error > node-gyp-build
3041 error
3041 error
3041 error   ACTION binding_gyp_libzk_target_build_zk_client_lib .
3041 error   CC       cli.o
3041 error   CC       zookeeper.lo
3041 error   CC       recordio.lo
3041 error   CC       zookeeper.jute.lo
3041 error   CC       zk_log.lo
3041 error   CC       zk_hashtable.lo
3041 error   CC       addrvec.lo
3041 error   CC       zk_sasl.lo
3041 error   CC       st_adaptor.lo
3041 error   CCLD     libzkst.la
3041 error   CC       hashtable_itr.lo
3041 error   CC       hashtable.lo
3041 error   CCLD     libhashtable.la
3041 error   CCLD     libzookeeper_st.la
3041 error   CCLD     cli_st
3041 error   TOUCH Release/obj.target/libzk.stamp
3041 error   CXX(target) Release/obj.target/zookeeper/src/node-zk.o
3042 error gyp info it worked if it ends with ok
3042 error gyp info using node-gyp@10.1.0
3042 error gyp info using node@22.2.0 | darwin | arm64
3042 error gyp info find Python using Python version 3.12.3 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
3042 error gyp info spawn /opt/homebrew/opt/python@3.12/bin/python3.12
3042 error gyp info spawn args [
3042 error gyp info spawn args '/Users/karl.stoney/.nvm/versions/node/v22.2.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
3042 error gyp info spawn args 'binding.gyp',
3042 error gyp info spawn args '-f',
3042 error gyp info spawn args 'make',
3042 error gyp info spawn args '-I',
3042 error gyp info spawn args '/Users/karl.stoney/git/autotrader/solr-overwatch/node_modules/zookeeper/build/config.gypi',
3042 error gyp info spawn args '-I',
3042 error gyp info spawn args '/Users/karl.stoney/.nvm/versions/node/v22.2.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
3042 error gyp info spawn args '-I',
3042 error gyp info spawn args '/Users/karl.stoney/Library/Caches/node-gyp/22.2.0/include/node/common.gypi',
3042 error gyp info spawn args '-Dlibrary=shared_library',
3042 error gyp info spawn args '-Dvisibility=default',
3042 error gyp info spawn args '-Dnode_root_dir=/Users/karl.stoney/Library/Caches/node-gyp/22.2.0',
3042 error gyp info spawn args '-Dnode_gyp_dir=/Users/karl.stoney/.nvm/versions/node/v22.2.0/lib/node_modules/npm/node_modules/node-gyp',
3042 error gyp info spawn args '-Dnode_lib_file=/Users/karl.stoney/Library/Caches/node-gyp/22.2.0/<(target_arch)/node.lib',
3042 error gyp info spawn args '-Dmodule_root_dir=/Users/karl.stoney/git/autotrader/solr-overwatch/node_modules/zookeeper',
3042 error gyp info spawn args '-Dnode_engine=v8',
3042 error gyp info spawn args '--depth=.',
3042 error gyp info spawn args '--no-parallel',
3042 error gyp info spawn args '--generator-output',
3042 error gyp info spawn args 'build',
3042 error gyp info spawn args '-Goutput_dir=.'
3042 error gyp info spawn args ]
3042 error gyp info spawn make
3042 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
3042 error configure: WARNING: cannot build SSL support -- openssl not found
3042 error ../src/node-zk.cpp:150:131: error: use of undeclared identifier 'PROHIBITS_OVERWRITING'
3042 error         Nan::SetAccessor(constructor_template->InstanceTemplate(), LOCAL_STRING("state"), StatePropertyGetter, 0, Local<Value>(), PROHIBITS_OVERWRITING, ReadOnly);
3042 error                                                                                                                                   ^
3042 error ../src/node-zk.cpp:151:138: error: use of undeclared identifier 'PROHIBITS_OVERWRITING'
3042 error         Nan::SetAccessor(constructor_template->InstanceTemplate(), LOCAL_STRING("client_id"), ClientidPropertyGetter, 0, Local<Value>(), PROHIBITS_OVERWRITING, ReadOnly);
3042 error                                                                                                                                          ^
3042 error ../src/node-zk.cpp:152:150: error: use of undeclared identifier 'PROHIBITS_OVERWRITING'
3042 error         Nan::SetAccessor(constructor_template->InstanceTemplate(), LOCAL_STRING("client_password"), ClientPasswordPropertyGetter, 0, Local<Value>(), PROHIBITS_OVERWRITING, ReadOnly);
3042 error                                                                                                                                                      ^
3042 error ../src/node-zk.cpp:153:142: error: use of undeclared identifier 'PROHIBITS_OVERWRITING'
3042 error         Nan::SetAccessor(constructor_template->InstanceTemplate(), LOCAL_STRING("timeout"), SessionTimeoutPropertyGetter, 0, Local<Value>(), PROHIBITS_OVERWRITING, ReadOnly);
3042 error                                                                                                                                              ^
3042 error ../src/node-zk.cpp:154:152: error: use of undeclared identifier 'PROHIBITS_OVERWRITING'
3042 error         Nan::SetAccessor(constructor_template->InstanceTemplate(), LOCAL_STRING("is_unrecoverable"), IsUnrecoverablePropertyGetter, 0, Local<Value>(), PROHIBITS_OVERWRITING, ReadOnly);
3042 error                                                                                                                                                        ^
3042 error ../src/node-zk.cpp:517:9: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
3042 error         sprintf(idbuff, "%llx", _LL_CAST_ id);
3042 error         ^
3042 error /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
3042 error __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
3042 error ^
3042 error /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
3042 error         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
3042 error                                                       ^
3042 error 1 warning and 5 errors generated.
3042 error make: *** [Release/obj.target/zookeeper/src/node-zk.o] Error 1
3042 error gyp ERR! build error 
3042 error gyp ERR! stack Error: `make` failed with exit code: 2
3042 error gyp ERR! stack at ChildProcess.<anonymous> (/Users/karl.stoney/.nvm/versions/node/v22.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
3042 error gyp ERR! System Darwin 23.3.0
3042 error gyp ERR! command "/Users/karl.stoney/.nvm/versions/node/v22.2.0/bin/node" "/Users/karl.stoney/.nvm/versions/node/v22.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
3042 error gyp ERR! cwd /Users/karl.stoney/git/autotrader/solr-overwatch/node_modules/zookeeper
3042 error gyp ERR! node -v v22.2.0
3042 error gyp ERR! node-gyp -v v10.1.0
3042 error gyp ERR! not ok
3043 verbose exit 1
3044 verbose code 1

Tried this inside docker too on a centos base (ruling it out being a macosx problem)

DavidVujic commented 5 months ago

Hi @Stono! Thank you for reporting about this. I think this is caused by a missing OS dependency (openssl). There are no prebuilds currently for Node.js v.22 and the installer will fallback into creating a Node.js AddOn during the install process for this version. I will try this too later on to verify that is the case.

I usually provide prebuilds for the current LTS and one version before in the package.

DavidVujic commented 5 months ago

Ignore the previous comment from me 😄 It seems to be a different kind of problem and likely a bug.

DavidVujic commented 5 months ago

Hello again @Stono, I have published a new version (v 6.2.0) that should solve this issue. Thank you again for reporting! 👏

The installer will print out one warning though, and I believe these are Mac OS X specific:

../src/node-zk.cpp:517:9: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
        sprintf(idbuff, "%llx", _LL_CAST_ id);

Closing this, please reopen or create a new issue if you still have problems with installing this package.

Stono commented 5 months ago

Ah thank you so much, really appreciated!

On Sat, 25 May 2024, 12:28 David Vujic, @.***> wrote:

Closed #343 https://github.com/yfinkelstein/node-zookeeper/issues/343 as completed.

— Reply to this email directly, view it on GitHub https://github.com/yfinkelstein/node-zookeeper/issues/343#event-12932506388, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALK7CMHR2PSDXM7VLG73QTZEBYWLAVCNFSM6AAAAABIHOURBOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJSHEZTENJQGYZTQOA . You are receiving this because you were mentioned.Message ID: @.***>