serialport / node-serialport

Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!
https://serialport.io
MIT License
5.8k stars 1.01k forks source link

Failing to build Node SerialPort on KDE Neon Linux #2145

Closed leni1 closed 3 years ago

leni1 commented 3 years ago

Summary of Problem

(Please answer all 3)

serialport@6.2.2 install /home/user/MyProject/app/node_modules/serialport prebuild-install || node-gyp rebuild

make: Entering directory '/home/user/MyProject/app/node_modules/serialport/build' CXX(target) Release/obj.target/serialport/src/serialport.o In file included from ../src/./serialport.h:6, from ../src/serialport.cpp:1: ../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker)': ../../nan/nan.h:2294:62: 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] 2294 | , reinterpret_cast(AsyncExecuteComplete) | ^ ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)': ../src/serialport.cpp:41:49: warning: 'v8::String::Utf8Value::Utf8Value(v8::Local)' is deprecated: Use Isolate version [-Wdeprecated-declarations] 41 | v8::String::Utf8Value path(info[0]->ToString()); | ^ In file included from /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:26, from /home/user/.cache/node-gyp/10.20.1/include/node/node.h:63, from ../../nan/nan.h:56, from ../src/./serialport.h:6, from ../src/serialport.cpp:1: /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:2892:28: note: declared here 2892 | explicit Utf8Value(Local obj)); | ^~~~~ /home/user/.cache/node-gyp/10.20.1/include/node/v8config.h:324:3: note: in definition of macro 'V8_DEPRECATED' 324 | declarator attribute((deprecated(message))) | ^~~~~~ ../src/serialport.cpp:48:53: warning: 'v8::Local v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations] 48 | v8::Local options = info[1]->ToObject(); | ^ In file included from /home/user/.cache/node-gyp/10.20.1/include/node/node.h:63, from ../../nan/nan.h:56, from ../src/./serialport.h:6, from ../src/serialport.cpp:1: /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:10046:15: note: declared here 10046 | Local Value::ToObject() const { | ^~~~~ ../src/serialport.cpp:78:69: 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] 78 | uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen); | ^~~~~ ../src/serialport.cpp: In function 'void EIO_AfterOpen(uv_work_t)': ../src/serialport.cpp:95:30: warning: 'v8::Local Nan::Callback::Call(int, v8::Local) const' is deprecated [-Wdeprecated-declarations] 95 | data->callback.Call(2, argv); | ^ In file included from ../src/./serialport.h:6, from ../src/serialport.cpp:1: ../../nan/nan.h:1742:3: note: declared here 1742 | Call(int argc, v8::Local argv[]) const { | ^~~~ ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)': ../src/serialport.cpp:113:53: warning: 'v8::Local v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations] 113 | v8::Local options = info[1]->ToObject(); | ^ In file included from /home/user/.cache/node-gyp/10.20.1/include/node/node.h:63, from ../../nan/nan.h:56, from ../src/./serialport.h:6, from ../src/serialport.cpp:1: /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:10046:15: note: declared here 10046 | Local Value::ToObject() const { | ^~~~~ ../src/serialport.cpp:135:71: 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] 135 | uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate); | ^~~~~~~ ../src/serialport.cpp: In function 'void EIO_AfterUpdate(uv_work_t)': ../src/serialport.cpp:150:30: warning: 'v8::Local Nan::Callback::Call(int, v8::Local) const' is deprecated [-Wdeprecated-declarations] 150 | data->callback.Call(1, argv); | ^ In file included from ../src/./serialport.h:6, from ../src/serialport.cpp:1: ../../nan/nan.h:1742:3: note: declared here 1742 | Call(int argc, v8::Local argv[]) const { | ^~~~ ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)': ../src/serialport.cpp:175:70: 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] 175 | uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose); | ^~~~~~ ../src/serialport.cpp: In function 'void EIO_AfterClose(uv_work_t)': ../src/serialport.cpp:188:30: warning: 'v8::Local Nan::Callback::Call(int, v8::Local) const' is deprecated [-Wdeprecated-declarations] 188 | data->callback.Call(1, argv); | ^ In file included from ../src/./serialport.h:6, from ../src/serialport.cpp:1: ../../nan/nan.h:1742:3: note: declared here 1742 | Call(int argc, v8::Local argv[]) const { | ^~~~ ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)': ../src/serialport.cpp:215:70: 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] 215 | uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush); | ^~~~~~ ../src/serialport.cpp: In function 'void EIO_AfterFlush(uv_work_t)': ../src/serialport.cpp:231:30: warning: 'v8::Local Nan::Callback::Call(int, v8::Local) const' is deprecated [-Wdeprecated-declarations] 231 | data->callback.Call(1, argv); | ^ In file included from ../src/./serialport.h:6, from ../src/serialport.cpp:1: ../../nan/nan.h:1742:3: note: declared here 1742 | Call(int argc, v8::Local argv[]) const { | ^~~~ ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)': ../src/serialport.cpp:250:53: warning: 'v8::Local v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations] 250 | v8::Local options = info[1]->ToObject(); | ^ In file included from /home/user/.cache/node-gyp/10.20.1/include/node/node.h:63, from ../../nan/nan.h:56, from ../src/./serialport.h:6, from ../src/serialport.cpp:1: /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:10046:15: note: declared here 10046 | Local Value::ToObject() const { | ^~~~~ ../src/serialport.cpp:270:68: 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] 270 | uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet); | ^~~~ ../src/serialport.cpp: In function 'void EIO_AfterSet(uv_work_t)': ../src/serialport.cpp:285:30: warning: 'v8::Local Nan::Callback::Call(int, v8::Local) const' is deprecated [-Wdeprecated-declarations] 285 | data->callback.Call(1, argv); | ^ In file included from ../src/./serialport.h:6, from ../src/serialport.cpp:1: ../../nan/nan.h:1742:3: note: declared here 1742 | Call(int argc, v8::Local argv[]) const { | ^~~~ ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)': ../src/serialport.cpp:314:68: 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] 314 | uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet); | ^~~~ ../src/serialport.cpp: In function 'void EIO_AfterGet(uv_work_t)': ../src/serialport.cpp:336:30: warning: 'v8::Local Nan::Callback::Call(int, v8::Local) const' is deprecated [-Wdeprecated-declarations] 336 | data->callback.Call(2, argv); | ^ In file included from ../src/./serialport.h:6, from ../src/serialport.cpp:1: ../../nan/nan.h:1742:3: note: declared here 1742 | Call(int argc, v8::Local argv[]) const { | ^~~~ ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)': ../src/serialport.cpp:363:76: 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] 363 | uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate); | ^~~~~~~~ ../src/serialport.cpp: In function 'void EIO_AfterGetBaudRate(uv_work_t)': ../src/serialport.cpp:383:30: warning: 'v8::Local Nan::Callback::Call(int, v8::Local) const' is deprecated [-Wdeprecated-declarations] 383 | data->callback.Call(2, argv); | ^ In file included from ../src/./serialport.h:6, from ../src/serialport.cpp:1: ../../nan/nan.h:1742:3: note: declared here 1742 | Call(int argc, v8::Local argv[]) const { | ^~~~ ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)': ../src/serialport.cpp:409:70: 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] 409 | uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain); | ^~~~~~ ../src/serialport.cpp: In function 'void EIO_AfterDrain(uv_work_t)': ../src/serialport.cpp:424:30: warning: 'v8::Local Nan::Callback::Call(int, v8::Local) const' is deprecated [-Wdeprecated-declarations] 424 | data->callback.Call(1, argv); | ^ In file included from ../src/./serialport.h:6, from ../src/serialport.cpp:1: ../../nan/nan.h:1742:3: note: declared here 1742 | Call(int argc, v8::Local argv[]) const { | ^~~~ ../src/serialport.cpp: At global scope: ../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of 'ToParityEnum' [-Wparentheses] 430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local& v8str)) { | ^ ../src/serialport.cpp:449:30: warning: unnecessary parentheses in declaration of 'ToStopBitEnum' [-Wparentheses] 449 | SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) { | ^ In file included from ../../nan/nan.h:56, from ../src/./serialport.h:6, from ../src/serialport.cpp:1: /home/user/.cache/node-gyp/10.20.1/include/node/node.h:573:43: warning: cast between incompatible function types from 'void ()(v8::Handle)' {aka 'void ()(v8::Local)'} to 'node::addon_register_func' {aka 'void ()(v8::Local, v8::Local, void)'} [-Wcast-function-type] 573 | (node::addon_register_func) (regfunc), \ | ^ /home/user/.cache/node-gyp/10.20.1/include/node/node.h:607:3: note: in expansion of macro 'NODE_MODULE_X' 607 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) | ^~~~~ ../src/serialport.cpp:485:1: note: in expansion of macro 'NODE_MODULE' 485 | NODE_MODULE(serialport, init); | ^~~ In file included from /home/user/.cache/node-gyp/10.20.1/include/node/node.h:63, from ../../nan/nan.h:56, from ../src/./serialport.h:6, from ../src/serialport.cpp:1: /home/user/.cache/node-gyp/10.20.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfo&)]': /home/user/.cache/node-gyp/10.20.1/include/node/node_object_wrap.h:84:78: required from here /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:9502:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo::Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} to 'Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} [-Wcast-function-type] 9502 | reinterpret_cast(callback), type); | ^~~~~~~~ /home/user/.cache/node-gyp/10.20.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfo&)]': ../../nan/nan_object_wrap.h:65:61: required from here /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:9502:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo::Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} to 'Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} [-Wcast-function-type] CXX(target) Release/obj.target/serialport/src/serialport_unix.o In file included from ../src/serialport.h:6, from ../src/serialport_unix.cpp:2: ../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker)': ../../nan/nan.h:2294:62: 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] 2294 | , reinterpret_cast(AsyncExecuteComplete) | ^ In file included from /home/user/.cache/node-gyp/10.20.1/include/node/node.h:63, from ../../nan/nan.h:56, from ../src/serialport.h:6, from ../src/serialport_unix.cpp:2: /home/user/.cache/node-gyp/10.20.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfo&)]': /home/user/.cache/node-gyp/10.20.1/include/node/node_object_wrap.h:84:78: required from here /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:9502:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo::Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} to 'Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} [-Wcast-function-type] 9502 | reinterpret_cast(callback), type); | ^~~~~~~~ /home/user/.cache/node-gyp/10.20.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfo&)]': ../../nan/nan_object_wrap.h:65:61: required from here /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:9502:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo::Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} to 'Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} [-Wcast-function-type] ../src/serialport_unix.cpp: In function 'int setup(int, OpenBaton)': ../src/serialport_unix.cpp:176:82: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 1005 [-Wformat-truncation=] 176 | snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path); | ^~ In file included from /usr/include/stdio.h:867, from ../src/serialport.h:3, from ../src/serialport_unix.cpp:2: /usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: 'builtin___snprintf_chk' output 20 or more bytes (assuming 1043) into a destination of size 1024 67 | return builtin_snprintf_chk (s, n, USE_FORTIFY_LEVEL - 1, | ~~~~~^~~~~~~~~~~ 68 | bos (s), fmt, va_arg_pack ()); | ~~~~~~~~~ ../src/serialport_unix.cpp: In function 'void EIO_Open(uv_work_t)': ../src/serialport_unix.cpp:86:84: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 1003 [-Wformat-truncation=] 86 | snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path); | ^~ In file included from /usr/include/stdio.h:867, from ../src/serialport.h:3, from ../src/serialport_unix.cpp:2: /usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: 'builtin___snprintf_chk' output 22 or more bytes (assuming 1045) into a destination of size 1024 67 | return builtin_snprintf_chk (s, n, USE_FORTIFY_LEVEL - 1, | ~~~~~^~~~~~~~~~~ 68 | bos (s), fmt, va_arg_pack ()); | ~~~~~~~~~ CXX(target) Release/obj.target/serialport/src/poller.o In file included from ../src/poller.cpp:1: ../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker)': ../../nan/nan.h:2294:62: 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] 2294 | , reinterpret_cast(AsyncExecuteComplete) | ^ ../src/poller.cpp: In static member function 'static void Poller::onData(uv_poll_t, int, int)': ../src/poller.cpp:69:29: warning: 'v8::Local Nan::Callback::Call(int, v8::Local) const' is deprecated [-Wdeprecated-declarations] 69 | obj->callback.Call(2, argv); | ^ In file included from ../src/poller.cpp:1: ../../nan/nan.h:1742:3: note: declared here 1742 | Call(int argc, v8::Local argv[]) const { | ^~~~ In file included from /home/user/.cache/node-gyp/10.20.1/include/node/node.h:63, from ../../nan/nan.h:56, from ../src/poller.cpp:1: /home/user/.cache/node-gyp/10.20.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfo&)]': /home/user/.cache/node-gyp/10.20.1/include/node/node_object_wrap.h:84:78: required from here /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:9502:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo::Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} to 'Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} [-Wcast-function-type] 9502 | reinterpret_cast(callback), type); | ^~~~~~~~ /home/user/.cache/node-gyp/10.20.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfo&)]': ../../nan/nan_object_wrap.h:65:61: required from here /home/user/.cache/node-gyp/10.20.1/include/node/v8.h:9502:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo::Callback' {aka 'void ()(const v8::WeakCallbackInfo&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo&)'} [-Wcast-function-type] CXX(target) Release/obj.target/serialport/src/serialport_linux.o SOLINK_MODULE(target) Release/obj.target/serialport.node COPY Release/serialport.node make: Leaving directory '/home/user/MyProject/app/node_modules/serialport/build' serialport@6.2.2 /home/user/MyProject/app/node_modules/serialport


- What should have happened?
A successful build of `serialport`

### Code to Reproduce the Issue
`npm rebuild serialport --build-from-source`

### Versions, Operating System and Hardware

- SerialPort@6.2.2
- Node.js v10.20.1
- Linux: [KDE Neon](https://neon.kde.org/) 5.19.5
- Hardware and chipset: Intel i7-8550U CPU
fivdi commented 3 years ago

The messages that are being displayed are warnings rather than errors and shouldn't result in any problems. It looks like serialport was built successfully and I would expect it to function correctly. Please give it a try to see if it works.

leni1 commented 3 years ago

Hi. Thanks for letting me know. Closing this since serialport seems to be working. The problem may be coming from somewhere else. 😃