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

Fails to build when using node v21.7.3 #107

Open
MayamaTakeshi opened this issue Jun 8, 2024 · 1 comment
Open

Fails to build when using node v21.7.3 #107

MayamaTakeshi opened this issue Jun 8, 2024 · 1 comment

Comments

@MayamaTakeshi
Copy link
Owner

MayamaTakeshi commented Jun 8, 2024

Tried by doing:

docker run -it debian:bookworm-slim /bin/bash

Then inside the container:

apt update
apt install -y curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
. ~/.nvm/nvm.sh
nvm i v21.7.3
mkdir -p /root/tmp/t1
cd /root/tmp/t1
npm init -y
apt install -y build-essential automake autoconf libtool libspeex-dev libopus-dev libsdl2-dev libavdevice-dev libswscale-dev libv4l-dev libopencore-amrnb-dev libopencore-amrwb-dev libvo-amrwbenc-dev libvo-amrwbenc-dev libboost-dev libtiff-dev libpcap-dev libssl-dev uuid-dev flite-dev cmake git wget
npm i sip-lab

But got:

 = Napi::Value (*)(const Napi::CallbackInfo&); napi_env = napi_env__*]'
npm ERR! ../src/addon.cpp:1382:43:   required from here
npm ERR! /root/tmp/t1/node_modules/node-addon-api/napi-inl.h:62:47: error: invalid conversion from 'napi_finalize' {aka 'void (*)(napi_env__*, void*, void*)'} to 'node_api_nogc_finalize' {aka 'void (*)(const napi_env__*, void*, void*)'} [-fpermissive]
npm ERR!    62 |   status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr);
npm ERR!       |                                               ^~~~~~~~~
npm ERR!       |                                               |
npm ERR!       |                                               napi_finalize {aka void (*)(napi_env__*, void*, void*)}
npm ERR! In file included from /root/.cache/node-gyp/21.7.3/include/node/node_api.h:12,
npm ERR!                  from /root/tmp/t1/node_modules/node-addon-api/napi.h:4:
npm ERR! /root/.cache/node-gyp/21.7.3/include/node/js_native_api.h:523:43: note:   initializing argument 4 of 'napi_status napi_add_finalizer(napi_env, napi_value, void*, node_api_nogc_finalize, void*, napi_ref__**)'
npm ERR!   523 |                    node_api_nogc_finalize finalize_cb,
npm ERR!       |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
npm ERR! make: *** [addon.target.mk:185: Release/obj.target/addon/src/addon.o] 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 (/root/tmp/t1/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Linux 6.5.0-35-generic
npm ERR! gyp ERR! command "/root/.nvm/versions/node/v21.7.3/bin/node" "/root/tmp/t1/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /root/tmp/t1/node_modules/sip-lab
npm ERR! gyp ERR! node -v v21.7.3
npm ERR! gyp ERR! node-gyp -v v9.4.1
npm ERR! gyp ERR! not ok

But switching to node v16.20.2 in the same container worked. However, all samples segfault:

root@636c5c5b0748:~/tmp/t1/node_modules/sip-lab# node -v
v16.20.2
root@636c5c5b0748:~/tmp/t1/node_modules/sip-lab# node samples/simple.js 
pjw_init thread_id=49937

03:42:37.202         os_core_unix.c !pjlib 2.14-dev for POSIX initialized
Segmentation fault (core dumped)

However using node 17, 18, 19, 20 and 21 works without problems using the same build for node 16.

@MayamaTakeshi
Copy link
Owner Author

The same happens with node v20:

npm error /root/tmp/t2/node_modules/node-addon-api/napi-inl.h: In instantiation of 'napi_status Napi::details::AttachData(napi_env, napi_value, FreeType*, napi_finalize, void*) [with FreeType = CallbackData<Napi::Value (*)(const Napi::CallbackInfo&), Napi::Value>; napi_env = napi_env__*; napi_value = napi_value__*; napi_finalize = void (*)(napi_env__*, void*, void*)]':
npm error /root/tmp/t2/node_modules/node-addon-api/napi-inl.h:2188:39:   required from 'napi_status Napi::CreateFunction(napi_env, const char*, napi_callback, CbData*, napi_value__**) [with CbData = details::CallbackData<Value (*)(const CallbackInfo&), Value>; napi_env = napi_env__*; napi_callback = napi_value__* (*)(napi_env__*, napi_callback_info__*); napi_value = napi_value__*]'
npm error /root/tmp/t2/node_modules/node-addon-api/napi-inl.h:2245:21:   required from 'static Napi::Function Napi::Function::New(napi_env, Callable, const char*, void*) [with Callable = Napi::Value (*)(const Napi::CallbackInfo&); napi_env = napi_env__*]'
npm error ../src/addon.cpp:1382:43:   required from here
npm error /root/tmp/t2/node_modules/node-addon-api/napi-inl.h:62:47: error: invalid conversion from 'napi_finalize' {aka 'void (*)(napi_env__*, void*, void*)'} to 'node_api_nogc_finalize' {aka 'void (*)(const napi_env__*, void*, void*)'} [-fpermissive]
npm error    62 |   status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr);
npm error       |                                               ^~~~~~~~~
npm error       |                                               |
npm error       |                                               napi_finalize {aka void (*)(napi_env__*, void*, void*)}
npm error In file included from /root/.cache/node-gyp/20.14.0/include/node/node_api.h:12,
npm error                  from /root/tmp/t2/node_modules/node-addon-api/napi.h:4:
npm error /root/.cache/node-gyp/20.14.0/include/node/js_native_api.h:523:43: note:   initializing argument 4 of 'napi_status napi_add_finalizer(napi_env, napi_value, void*, node_api_nogc_finalize, void*, napi_ref__**)'
npm error   523 |                    node_api_nogc_finalize finalize_cb,
npm error       |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
npm error make: *** [addon.target.mk:185: Release/obj.target/addon/src/addon.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.onExit (/root/tmp/t2/node_modules/node-gyp/lib/build.js:203:23)
npm error gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
npm error gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm error gyp ERR! System Linux 6.5.0-35-generic
npm error gyp ERR! command "/root/.nvm/versions/node/v20.14.0/bin/node" "/root/tmp/t2/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /root/tmp/t2/node_modules/sip-lab
npm error gyp ERR! node -v v20.14.0
npm error gyp ERR! node-gyp -v v9.4.1
npm error gyp ERR! not ok

npm error A complete log of this run can be found in: /root/.npm/_logs/2024-06-08T03_47_05_888Z-debug-0.log

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

1 participant