microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.46k stars 235 forks source link

build fails on WSL2 Ubuntu 20.04 #518

Closed peterdresslar closed 1 year ago

peterdresslar commented 2 years ago

Environment details

Issue description

When used as a dependency, or simply cloning and installing, a build error occurs. Thought this was the node 15+ issue at first, but apparently not, as 12+ also fails similarly to build. Possibly I am missing a dependency or have something odd going on due to working in WSL2. Is this a nan issue? Not sure.

pd@DESKTOP-UKSGQ85:~/workspace/node-pty$ npm install
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated fsevents@2.1.3: "Please update to latest v2.3 or v2.2"

> node-pty@0.10.0 install /home/pd/workspace/node-pty
> node scripts/install.js

make: Entering directory '/home/pd/workspace/node-pty/build'
  CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc: In function ‘void pty_after_waitpid(uv_async_t*)’:
../src/unix/pty.cc:534:43: warning: ‘void* memset(void*, int, size_t)’ writing to an object of type ‘class Nan::Persistent<v8::Function>’ with no trivial copy-assignment [-Wclass-memaccess]
  534 |   memset(&baton->cb, -1, sizeof(baton->cb));
      |                                           ^
In file included from ../node_modules/nan/nan.h:407,
                 from ../src/unix/pty.cc:20:
../node_modules/nan/nan_persistent_12_inl.h:12:40: note: ‘class Nan::Persistent<v8::Function>’ declared here
   12 | template<typename T, typename M> class Persistent :
      |                                        ^~~~~~~~~~
In file included from ../node_modules/nan/nan.h:58,
                 from ../src/unix/pty.cc:20:
../src/unix/pty.cc: At global scope:
/home/pd/.cache/node-gyp/14.18.2/include/node/node.h:787: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]
  787 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/home/pd/.cache/node-gyp/14.18.2/include/node/node.h:821:3: note: in expansion of macro ‘NODE_MODULE_X’
  821 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/unix/pty.cc:707:1: note: in expansion of macro ‘NODE_MODULE’
  707 | NODE_MODULE(pty, init)
      | ^~~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/pty.node
  COPY Release/pty.node
  CXX(target) Release/obj.target/spawn-helper/src/unix/spawn-helper.o
  LINK(target) Release/spawn-helper
make: Leaving directory '/home/pd/workspace/node-pty/build'
Tyriar commented 1 year ago

It looks like those are just warnings