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.82k stars 1.01k forks source link

Errors/Warnings while creating a Docker image with Alpine Linux #2131

Closed mn567 closed 4 years ago

mn567 commented 4 years ago

Getting Errors/Warning in a Docker project using Alpine Linux

(Please answer all 3)

Creating a Docker image using Alpine Linux Getting compilation warnings Should build without warnings

This is the Docker file #1 which gives warnings (Docker file #2 is at the end)

FROM node:12.18.3-alpine3.12 as builder

COPY package*.json ./

RUN apk add --no-cache make gcc g++ python2 linux-headers udev

RUN npm install serialport --unsafe-perm --build-from-source=serialport

RUN npm ci --only=production

FROM node:12.18.3-alpine3.12

WORKDIR /opt/adapters/Modbus

COPY --from=builder node_modules .

COPY . .

Add Tini

ENV TINI_VERSION v0.19.0 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini RUN chmod +x /tini ENTRYPOINT ["/tini", "--"]

CMD [ "node", "index.js" ]



The following are the warnings

 docker build -t modbus:1.0 .
Sending build context to Docker daemon  18.31MB
Step 1/14 : FROM node:12.18.3-alpine3.12 as builder
 ---> 73e8a4cf7fa8
Step 2/14 : COPY package*.json ./
 ---> Using cache
 ---> fc00e97c16e4
Step 3/14 : RUN apk add --no-cache make gcc g++ python2 linux-headers udev
 ---> Running in 90cc1d086c3e
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/30) Upgrading musl (1.1.24-r8 -> 1.1.24-r9)
(2/30) Installing binutils (2.34-r1)
(3/30) Installing gmp (6.2.0-r0)
(4/30) Installing isl (0.18-r0)
(5/30) Installing libgomp (9.3.0-r2)
(6/30) Installing libatomic (9.3.0-r2)
(7/30) Installing libgphobos (9.3.0-r2)
(8/30) Installing mpfr4 (4.0.2-r4)
(9/30) Installing mpc1 (1.1.0-r1)
(10/30) Installing gcc (9.3.0-r2)
(11/30) Installing musl-dev (1.1.24-r9)
(12/30) Installing libc-dev (0.7.2-r3)
(13/30) Installing g++ (9.3.0-r2)
(14/30) Installing linux-headers (5.4.5-r1)
(15/30) Installing make (4.3-r0)
(16/30) Installing libbz2 (1.0.8-r1)
(17/30) Installing expat (2.2.9-r1)
(18/30) Installing libffi (3.3-r2)
(19/30) Installing gdbm (1.13-r1)
(20/30) Installing ncurses-terminfo-base (6.2_p20200523-r0)
(21/30) Installing ncurses-libs (6.2_p20200523-r0)
(22/30) Installing readline (8.0.4-r0)
(23/30) Installing sqlite-libs (3.32.1-r0)
(24/30) Installing python2 (2.7.18-r0)
(25/30) Installing udev-init-scripts (33-r1)
Executing udev-init-scripts-33-r1.post-install
(26/30) Installing eudev-libs (3.2.9-r3)
(27/30) Installing libblkid (2.35.2-r0)
(28/30) Installing xz-libs (5.2.5-r0)
(29/30) Installing kmod-libs (27-r0)
(30/30) Installing eudev (3.2.9-r3)
Executing busybox-1.31.1-r16.trigger
Executing eudev-3.2.9-r3.trigger
OK: 249 MiB in 45 packages
Removing intermediate container 90cc1d086c3e
 ---> 1406a1b36bcc
Step 4/14 : RUN npm install serialport --unsafe-perm --build-from-source=serialport
 ---> Running in 22e44f960615

> @serialport/bindings@2.0.8 install /node_modules/modbus-serial/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

make: Entering directory '/node_modules/modbus-serial/node_modules/@serialport/bindings/build'
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)':
../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 'Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)':
../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 '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 '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 'Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)':
../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 '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:329:96: warning: 'bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)' is deprecated: Use maybe version [-Wdeprecated-declarations]
  329 |     results->Set(Nan::New<v8::String>("cts").ToLocalChecked(), Nan::New<v8::Boolean>(data->cts));
      |                                                                                                ^
In file included from /root/.cache/node-gyp/12.18.3/include/node/v8-internal.h:14,
                 from /root/.cache/node-gyp/12.18.3/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.18.3/include/node/node.h:67,
                 from ../../../../../nan/nan.h:56,
                 from ../src/./serialport.h:6,
                 from ../src/serialport.cpp:1:
/root/.cache/node-gyp/12.18.3/include/node/v8.h:3499:22: note: declared here
 3499 |                 bool Set(Local<Value> key, Local<Value> value));
      |                      ^~~
/root/.cache/node-gyp/12.18.3/include/node/v8config.h:328:3: note: in definition of macro 'V8_DEPRECATED'
  328 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/serialport.cpp:330:96: warning: 'bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)' is deprecated: Use maybe version [-Wdeprecated-declarations]
  330 |     results->Set(Nan::New<v8::String>("dsr").ToLocalChecked(), Nan::New<v8::Boolean>(data->dsr));
      |                                                                                                ^
In file included from /root/.cache/node-gyp/12.18.3/include/node/v8-internal.h:14,
                 from /root/.cache/node-gyp/12.18.3/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.18.3/include/node/node.h:67,
                 from ../../../../../nan/nan.h:56,
                 from ../src/./serialport.h:6,
                 from ../src/serialport.cpp:1:
/root/.cache/node-gyp/12.18.3/include/node/v8.h:3499:22: note: declared here
 3499 |                 bool Set(Local<Value> key, Local<Value> value));
      |                      ^~~
/root/.cache/node-gyp/12.18.3/include/node/v8config.h:328:3: note: in definition of macro 'V8_DEPRECATED'
  328 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/serialport.cpp:331:96: warning: 'bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)' is deprecated: Use maybe version [-Wdeprecated-declarations]
  331 |     results->Set(Nan::New<v8::String>("dcd").ToLocalChecked(), Nan::New<v8::Boolean>(data->dcd));
      |                                                                                                ^
In file included from /root/.cache/node-gyp/12.18.3/include/node/v8-internal.h:14,
                 from /root/.cache/node-gyp/12.18.3/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.18.3/include/node/node.h:67,
                 from ../../../../../nan/nan.h:56,
                 from ../src/./serialport.h:6,
                 from ../src/serialport.cpp:1:
/root/.cache/node-gyp/12.18.3/include/node/v8.h:3499:22: note: declared here
 3499 |                 bool Set(Local<Value> key, Local<Value> value));
      |                      ^~~
/root/.cache/node-gyp/12.18.3/include/node/v8config.h:328:3: note: in definition of macro 'V8_DEPRECATED'
  328 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../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:378:106: warning: 'bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)' is deprecated: Use maybe version [-Wdeprecated-declarations]
  378 |     results->Set(Nan::New<v8::String>("baudRate").ToLocalChecked(), Nan::New<v8::Integer>(data->baudRate));
      |                                                                                                          ^
In file included from /root/.cache/node-gyp/12.18.3/include/node/v8-internal.h:14,
                 from /root/.cache/node-gyp/12.18.3/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.18.3/include/node/node.h:67,
                 from ../../../../../nan/nan.h:56,
                 from ../src/./serialport.h:6,
                 from ../src/serialport.cpp:1:
/root/.cache/node-gyp/12.18.3/include/node/v8.h:3499:22: note: declared here
 3499 |                 bool Set(Local<Value> key, Local<Value> value));
      |                      ^~~
/root/.cache/node-gyp/12.18.3/include/node/v8config.h:328:3: note: in definition of macro 'V8_DEPRECATED'
  328 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../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: At global scope:
../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of 'ToParityEnum' [-Wparentheses]
  430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& 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:
/root/.cache/node-gyp/12.18.3/include/node/node.h:608:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
  608 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/root/.cache/node-gyp/12.18.3/include/node/node.h:642:3: note: in expansion of macro 'NODE_MODULE_X'
  642 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/serialport.cpp:483:1: note: in expansion of macro 'NODE_MODULE'
  483 | NODE_MODULE(serialport, init);
      | ^~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../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);
      |                                                                                  ^~
../src/serialport_unix.cpp:176:13: note: 'snprintf' output 20 or more bytes (assuming 1043) into a destination of size 1024
  176 |     snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../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);
      |                                                                                    ^~
../src/serialport_unix.cpp:86:13: note: 'snprintf' output 22 or more bytes (assuming 1045) into a destination of size 1024
   86 |     snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/bindings/src/serialport_linux.o
  SOLINK_MODULE(target) Release/obj.target/bindings.node
  COPY Release/bindings.node
make: Leaving directory '/node_modules/modbus-serial/node_modules/@serialport/bindings/build'

> @serialport/bindings@9.0.1 install /node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

make: Entering directory '/node_modules/@serialport/bindings/build'
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)':
../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 'Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)':
../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 '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 '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 'Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)':
../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 '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 '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 '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: At global scope:
../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of 'ToParityEnum' [-Wparentheses]
  430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& 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:
/root/.cache/node-gyp/12.18.3/include/node/node.h:608:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
  608 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/root/.cache/node-gyp/12.18.3/include/node/node.h:642:3: note: in expansion of macro 'NODE_MODULE_X'
  642 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/serialport.cpp:483:1: note: in expansion of macro 'NODE_MODULE'
  483 | NODE_MODULE(serialport, init);
      | ^~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../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);
      |                                                                                  ^~
../src/serialport_unix.cpp:176:13: note: 'snprintf' output 20 or more bytes (assuming 1043) into a destination of size 1024
  176 |     snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../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);
      |                                                                                    ^~
../src/serialport_unix.cpp:86:13: note: 'snprintf' output 22 or more bytes (assuming 1045) into a destination of size 1024
   86 |     snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/bindings/src/serialport_linux.o
  SOLINK_MODULE(target) Release/obj.target/bindings.node
  COPY Release/bindings.node
make: Leaving directory '/node_modules/@serialport/bindings/build'

> serialport@9.0.1 postinstall /node_modules/serialport
> node thank-you.js

Thank you for using serialport!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/serialport/donate

npm WARN Modbus@1.0.0 No description
npm WARN Modbus@1.0.0 No repository field.

+ serialport@9.0.1
added 119 packages from 157 contributors and audited 119 packages in 24.165s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Removing intermediate container 22e44f960615
 ---> 02e94ee360ef
Step 5/14 : RUN npm ci --only=production
 ---> Running in e0739af1005d
npm WARN prepare removing existing node_modules/ before installation

> @serialport/bindings@9.0.1 install /node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=12.18.3 runtime=node arch=x64 libc=musl platform=linux)
make: Entering directory '/node_modules/@serialport/bindings/build'
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)':
../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 'Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)':
../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 '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 '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 'Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)':
../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 '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 '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 '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: At global scope:
../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of 'ToParityEnum' [-Wparentheses]
  430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& 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:
/root/.cache/node-gyp/12.18.3/include/node/node.h:608:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
  608 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/root/.cache/node-gyp/12.18.3/include/node/node.h:642:3: note: in expansion of macro 'NODE_MODULE_X'
  642 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/serialport.cpp:483:1: note: in expansion of macro 'NODE_MODULE'
  483 | NODE_MODULE(serialport, init);
      | ^~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../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);
      |                                                                                  ^~
../src/serialport_unix.cpp:176:13: note: 'snprintf' output 20 or more bytes (assuming 1043) into a destination of size 1024
  176 |     snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../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);
      |                                                                                    ^~
../src/serialport_unix.cpp:86:13: note: 'snprintf' output 22 or more bytes (assuming 1045) into a destination of size 1024
   86 |     snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/bindings/src/serialport_linux.o
  SOLINK_MODULE(target) Release/obj.target/bindings.node
  COPY Release/bindings.node
make: Leaving directory '/node_modules/@serialport/bindings/build'

> serialport@9.0.1 postinstall /node_modules/serialport
> node thank-you.js

Thank you for using serialport!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/serialport/donate

> @serialport/bindings@2.0.8 install /node_modules/modbus-serial/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=12.18.3 runtime=node arch=x64 libc=musl platform=linux)
make: Entering directory '/node_modules/modbus-serial/node_modules/@serialport/bindings/build'
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)':
../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 'Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)':
../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 '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 '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 'Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)':
../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 '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:329:96: warning: 'bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)' is deprecated: Use maybe version [-Wdeprecated-declarations]
  329 |     results->Set(Nan::New<v8::String>("cts").ToLocalChecked(), Nan::New<v8::Boolean>(data->cts));
      |                                                                                                ^
In file included from /root/.cache/node-gyp/12.18.3/include/node/v8-internal.h:14,
                 from /root/.cache/node-gyp/12.18.3/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.18.3/include/node/node.h:67,
                 from ../../../../../nan/nan.h:56,
                 from ../src/./serialport.h:6,
                 from ../src/serialport.cpp:1:
/root/.cache/node-gyp/12.18.3/include/node/v8.h:3499:22: note: declared here
 3499 |                 bool Set(Local<Value> key, Local<Value> value));
      |                      ^~~
/root/.cache/node-gyp/12.18.3/include/node/v8config.h:328:3: note: in definition of macro 'V8_DEPRECATED'
  328 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/serialport.cpp:330:96: warning: 'bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)' is deprecated: Use maybe version [-Wdeprecated-declarations]
  330 |     results->Set(Nan::New<v8::String>("dsr").ToLocalChecked(), Nan::New<v8::Boolean>(data->dsr));
      |                                                                                                ^
In file included from /root/.cache/node-gyp/12.18.3/include/node/v8-internal.h:14,
                 from /root/.cache/node-gyp/12.18.3/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.18.3/include/node/node.h:67,
                 from ../../../../../nan/nan.h:56,
                 from ../src/./serialport.h:6,
                 from ../src/serialport.cpp:1:
/root/.cache/node-gyp/12.18.3/include/node/v8.h:3499:22: note: declared here
 3499 |                 bool Set(Local<Value> key, Local<Value> value));
      |                      ^~~
/root/.cache/node-gyp/12.18.3/include/node/v8config.h:328:3: note: in definition of macro 'V8_DEPRECATED'
  328 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../src/serialport.cpp:331:96: warning: 'bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)' is deprecated: Use maybe version [-Wdeprecated-declarations]
  331 |     results->Set(Nan::New<v8::String>("dcd").ToLocalChecked(), Nan::New<v8::Boolean>(data->dcd));
      |                                                                                                ^
In file included from /root/.cache/node-gyp/12.18.3/include/node/v8-internal.h:14,
                 from /root/.cache/node-gyp/12.18.3/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.18.3/include/node/node.h:67,
                 from ../../../../../nan/nan.h:56,
                 from ../src/./serialport.h:6,
                 from ../src/serialport.cpp:1:
/root/.cache/node-gyp/12.18.3/include/node/v8.h:3499:22: note: declared here
 3499 |                 bool Set(Local<Value> key, Local<Value> value));
      |                      ^~~
/root/.cache/node-gyp/12.18.3/include/node/v8config.h:328:3: note: in definition of macro 'V8_DEPRECATED'
  328 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../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:378:106: warning: 'bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)' is deprecated: Use maybe version [-Wdeprecated-declarations]
  378 |     results->Set(Nan::New<v8::String>("baudRate").ToLocalChecked(), Nan::New<v8::Integer>(data->baudRate));
      |                                                                                                          ^
In file included from /root/.cache/node-gyp/12.18.3/include/node/v8-internal.h:14,
                 from /root/.cache/node-gyp/12.18.3/include/node/v8.h:27,
                 from /root/.cache/node-gyp/12.18.3/include/node/node.h:67,
                 from ../../../../../nan/nan.h:56,
                 from ../src/./serialport.h:6,
                 from ../src/serialport.cpp:1:
/root/.cache/node-gyp/12.18.3/include/node/v8.h:3499:22: note: declared here
 3499 |                 bool Set(Local<Value> key, Local<Value> value));
      |                      ^~~
/root/.cache/node-gyp/12.18.3/include/node/v8config.h:328:3: note: in definition of macro 'V8_DEPRECATED'
  328 |   declarator __attribute__((deprecated(message)))
      |   ^~~~~~~~~~
../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: At global scope:
../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of 'ToParityEnum' [-Wparentheses]
  430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& 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:
/root/.cache/node-gyp/12.18.3/include/node/node.h:608:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
  608 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/root/.cache/node-gyp/12.18.3/include/node/node.h:642:3: note: in expansion of macro 'NODE_MODULE_X'
  642 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/serialport.cpp:483:1: note: in expansion of macro 'NODE_MODULE'
  483 | NODE_MODULE(serialport, init);
      | ^~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../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);
      |                                                                                  ^~
../src/serialport_unix.cpp:176:13: note: 'snprintf' output 20 or more bytes (assuming 1043) into a destination of size 1024
  176 |     snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../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);
      |                                                                                    ^~
../src/serialport_unix.cpp:86:13: note: 'snprintf' output 22 or more bytes (assuming 1045) into a destination of size 1024
   86 |     snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CXX(target) Release/obj.target/bindings/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<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/bindings/src/serialport_linux.o
  SOLINK_MODULE(target) Release/obj.target/bindings.node
  COPY Release/bindings.node
make: Leaving directory '/node_modules/modbus-serial/node_modules/@serialport/bindings/build'
added 118 packages in 16.38s
Removing intermediate container e0739af1005d
 ---> a2b1d10a0741
Step 6/14 : FROM node:12.18.3-alpine3.12
 ---> 73e8a4cf7fa8
Step 7/14 : WORKDIR /opt/adapters/Modbus
 ---> Using cache
 ---> 7fc56189d166
Step 8/14 : COPY --from=builder node_modules .
 ---> 001bdf133abc
Step 9/14 : COPY . .
 ---> 9375a19aa7d0
Step 10/14 : ENV TINI_VERSION v0.19.0
 ---> Running in e5f90cb5e4aa
Removing intermediate container e5f90cb5e4aa
 ---> 9ab6ea18487f
Step 11/14 : ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
Downloading [==================================================>]  870.5kB/870.5kB
 ---> db7c9e262719
Step 12/14 : RUN chmod +x /tini
 ---> Running in 0ecdd8de8a46
Removing intermediate container 0ecdd8de8a46
 ---> 3d8eabf5ba3d
Step 13/14 : ENTRYPOINT ["/tini", "--"]
 ---> Running in 71cb3760d8d6
Removing intermediate container 71cb3760d8d6
 ---> 7ef30bbea9db
Step 14/14 : CMD [ "node", "index.js" ]
 ---> Running in f14c7779e862
Removing intermediate container f14c7779e862
 ---> 2131a1fedeed
Successfully built 2131a1fedeed
Successfully tagged modbus:1.0
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.

----------------------------------------------------------------

This is the Docker file #2 which also gives simialr warnings (the difference is alpine version )

FROM node:12.18.3-alpine3.11 as builder

COPY package*.json ./

RUN apk add --no-cache make gcc g++ python linux-headers udev

RUN npm install serialport --unsafe-perm --build-from-source=serialport

RUN npm ci --only=production

FROM node:12.18.3-alpine3.12

WORKDIR /opt/adapters/Modbus

COPY --from=builder node_modules .

COPY . .

# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]

CMD [ "node", "index.js" ]
scyto commented 3 years ago

how did you fix this?

MBerka commented 3 years ago

@scyto Someone would have to go through the serialport C++ and resolve all the compiler warnings to avoid this noise, but an inverse grep on the build command could filter them out too.