microsoft / node-pty

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

Build fails with Node 12.22.1. #481

Closed ptrxyz closed 3 years ago

ptrxyz commented 3 years ago

Environment details

Issue description

This does not seem to build with node 12.22.1 (targeting Theia, "browser"-release):

│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@8.1.0
│ gyp info using node@12.22.1 | linux | x64
│ gyp info find Python using Python version 3.8.5 found at "/usr/bin/python3"
│ gyp info spawn /usr/bin/python3
│ gyp info spawn args [
│ gyp info spawn args   '/usr/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_main.py',
│ gyp info spawn args   'binding.gyp',
│ gyp info spawn args   '-f',
│ gyp info spawn args   'make',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/pkg/node_modules/.pnpm/@theia+node-pty@0.7.8-theia004/node_modules/@theia/node-pty/build/config.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/usr/lib/node_modules/pnpm/dist/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/root/.cache/node-gyp/12.22.1/include/node/common.gypi',
│ gyp info spawn args   '-Dlibrary=shared_library',
│ gyp info spawn args   '-Dvisibility=default',
│ gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/12.22.1',
│ gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/pnpm/dist/node_modules/node-gyp',
│ gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/12.22.1/<(target_arch)/node.lib',
│ gyp info spawn args   '-Dmodule_root_dir=/pkg/node_modules/.pnpm/@theia+node-pty@0.7.8-theia004/node_modules/@theia/node-pty',
│ gyp info spawn args   '-Dnode_engine=v8',
│ gyp info spawn args   '--depth=.',
│ gyp info spawn args   '--no-parallel',
│ gyp info spawn args   '--generator-output',
│ gyp info spawn args   'build',
│ gyp info spawn args   '-Goutput_dir=.'
│ gyp info spawn args ]
│ gyp info spawn make
│ gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
│ make: Entering directory '/pkg/node_modules/.pnpm/@theia+node-pty@0.7.8-theia004/node_modules/@theia/node-pty/build'
│   CXX(target) Release/obj.target/pty/src/unix/pty.o
│ In file included from ../../../../../nan@2.10.0/node_modules/nan/nan_converters.h:67,
│                  from ../../../../../nan@2.10.0/node_modules/nan/nan.h:202,
│                  from ../src/unix/pty.cc:20:
│ ../../../../../nan@2.10.0/node_modules/nan/nan_converters_43_inl.h: In static member function 'static Nan::imp::ToFactoryBase<v8::Boolean>::return_t Nan::imp::ToFactory<v8::Boo
│ ../../../../../nan@2.10.0/node_modules/nan/nan_converters_43_inl.h:18:51: warning: 'v8::MaybeLocal<v8::Boolean> v8::Value::ToBoolean(v8::Local<v8::Context>) const' is deprecate
│    18 |       val->To ## TYPE(isolate->GetCurrentContext())                            \
│       |                                                   ^
│ ../../../../../nan@2.10.0/node_modules/nan/nan_converters_43_inl.h:22:1: note: in expansion of macro 'X'
│    22 | X(Boolean)
│       | ^
│ In file included from /root/.cache/node-gyp/12.22.1/include/node/v8-internal.h:14,
│                  from /root/.cache/node-gyp/12.22.1/include/node/v8.h:27,
│                  from /root/.cache/node-gyp/12.22.1/include/node/node.h:67,
│                  from ../../../../../nan@2.10.0/node_modules/nan/nan.h:51,
│                  from ../src/unix/pty.cc:20:
│ /root/.cache/node-gyp/12.22.1/include/node/v8.h:2664:59: note: declared here

...(more stuff here...)

│ In file included from /root/.cache/node-gyp/12.22.1/include/node/node.h:67,
│                  from ../../../../../nan@2.10.0/node_modules/nan/nan.h:51,
│                  from ../src/unix/pty.cc:20:
│ /root/.cache/node-gyp/12.22.1/include/node/v8.h:6126:46: note: candidate: 'v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)'
│  6126 |   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
│       |                                              ^~~~~~~~~~~
│ /root/.cache/node-gyp/12.22.1/include/node/v8.h:6126:46: note:   candidate expects 1 argument, 0 provided
│ In file included from ../../../../../nan@2.10.0/node_modules/nan/nan.h:51,
│                  from ../src/unix/pty.cc:20:
│ ../src/unix/pty.cc: At global scope:
│ /root/.cache/node-gyp/12.22.1/include/node/node.h:736:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (
│   736 |       (node::addon_register_func) (regfunc),                          \
│       |                                           ^
│ /root/.cache/node-gyp/12.22.1/include/node/node.h:770:3: note: in expansion of macro 'NODE_MODULE_X'
│   770 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
│       |   ^~~~~~~~~~~~~
│ ../src/unix/pty.cc:824:1: note: in expansion of macro 'NODE_MODULE'
│   824 | NODE_MODULE(pty, init)
│       | ^~~~~~~~~~~
│ make: *** [pty.target.mk:111: Release/obj.target/pty/src/unix/pty.o] Error 1
│ make: Leaving directory '/pkg/node_modules/.pnpm/@theia+node-pty@0.7.8-theia004/node_modules/@theia/node-pty/build'
│ gyp ERR! build error 
│ gyp ERR! stack Error: `make` failed with exit code: 2
│ gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/pnpm/dist/node_modules/node-gyp/lib/build.js:194:23)
│ gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
│ gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
│ gyp ERR! System Linux 5.12.15-zen1-1-zen
│ gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
│ gyp ERR! cwd /pkg/node_modules/.pnpm/@theia+node-pty@0.7.8-theia004/node_modules/@theia/node-pty
│ gyp ERR! node -v v12.22.1
│ gyp ERR! node-gyp -v v8.1.0
│ gyp ERR! not ok 
└─ Failed in 552ms
Tyriar commented 3 years ago

v0.7.8 is very old, you should update

ptrxyz commented 3 years ago

Well, it seems to be a dependency of something. This is the packages I install as stated in the package.json:

    "@theia/callhierarchy": "next",
    "@theia/console": "next",
    "@theia/core": "next",
    "@theia/cpp": "next",
    "@theia/debug": "next",
    "@theia/debug-nodejs": "next",
    "@theia/editor": "next",
    "@theia/editor-preview": "next",
    "@theia/editorconfig": "next",
    "@theia/extension-manager": "next",
    "@theia/file-search": "next",
    "@theia/filesystem": "next",
    "@theia/getting-started": "next",
    "@theia/git": "next",
    "@theia/java": "next",
    "@theia/java-debug": "next",
    "@theia/json": "next",
    "@theia/keymaps": "next",
    "@theia/languages": "next",
    "@theia/markers": "next",
    "@theia/merge-conflicts": "next",
    "@theia/messages": "next",
    "@theia/metrics": "next",
    "@theia/mini-browser": "next",
    "@theia/monaco": "next",
    "@theia/navigator": "next",
    "@theia/outline-view": "next",
    "@theia/output": "next",
    "@theia/plugin-ext": "next",
    "@theia/plugin-ext-vscode": "next",
    "@theia/preferences": "next",
    "@theia/preview": "next",
    "@theia/process": "next",
    "@theia/python": "next",
    "@theia/ruby": "next",
    "@theia/search-in-workspace": "next",
    "@theia/task": "next",
    "@theia/terminal": "next",
    "@theia/textmate-grammars": "next",
    "@theia/tslint": "next",
    "@theia/typescript": "next",
    "@theia/userstorage": "next",
    "@theia/variable-resolver": "next",
    "@theia/workspace": "next"
Tyriar commented 3 years ago

I don't know, you should ask theia I guess?

@theia+node-pty@0.7.8-theia004

Installing the latest official package is just npm install node-pty

ptrxyz commented 3 years ago

Oh. Sorry, of course, you are right. ... I meesed up the Browser tabs. :facepalm: