nwjs / nw-gyp

native addon build tool for node-webkit
MIT License
195 stars 46 forks source link

Cannot build native module `node-pty` #138

Open hhhoney opened 4 years ago

hhhoney commented 4 years ago

relevant issue: https://github.com/nwjs/nw.js/issues/7473

Hello :), I found that some native modules (like node-pty) cannot be built under latest NW & nw-gyp.

NWJS Version : 0.45.6 nw-gyp version: 3.6.5 node version: 14.2.0 Operating System : macOS 10.15.4 (19E287) & Windows 10

How to reproduce

Just run following commands

npm i --save node-pty@0.10.0-beta8
cd node_modules/node-pty
nw-gyp rebuild --arch=x64 --target=0.45.6

Error Example

......
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc:669:10: error: use of undeclared identifier 'openpty'
  return openpty(amaster, aslave, name, (termios *)termp, (winsize *)winp);
         ^
../src/unix/pty.cc:717:10: error: use of undeclared identifier 'forkpty'
  return forkpty(amaster, name, (termios *)termp, (winsize *)winp);
         ^
2 errors generated.
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
......
GnorTech commented 4 years ago

A workaround is to remove ~/.nw-gyp/0.45.6/src/util.h

mightytyphoon commented 3 years ago

A workaround is to remove ~/.nw-gyp/0.45.6/src/util.h

I have also problems building node-pty, on windows, and I don't have this file. I am using the last version of nwjs 0.49.1 and I have only util-inl.h, debug_utils.h, json_utils.h...

mightytyphoon commented 3 years ago

relevant issue: https://github.com/nwjs/nw.js/issues/7473

Hello :), I found that some native modules (like node-pty) cannot be built under latest NW & nw-gyp.

NWJS Version : 0.45.6

nw-gyp version: 3.6.5

node version: 14.2.0

Operating System : macOS 10.15.4 (19E287) & Windows 10

How to reproduce

Just run following commands


npm i --save node-pty@0.10.0-beta8

cd node_modules/node-pty

nw-gyp rebuild --arch=x64 --target=0.45.6

Error Example


......

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]

  CXX(target) Release/obj.target/pty/src/unix/pty.o

../src/unix/pty.cc:669:10: error: use of undeclared identifier 'openpty'

  return openpty(amaster, aslave, name, (termios *)termp, (winsize *)winp);

         ^

../src/unix/pty.cc:717:10: error: use of undeclared identifier 'forkpty'

  return forkpty(amaster, name, (termios *)termp, (winsize *)winp);

         ^

2 errors generated.

make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1

......

Hi, do you know any nwjs / nw-gyp / node-pty versions trio that was possible to build ?

Thank you for your response