laverdet / node-fibers

Fiber/coroutine support for v8 and node.
MIT License
3.56k stars 224 forks source link

Doesn't build on Node 13 #424

Closed blackxored closed 4 years ago

blackxored commented 4 years ago

Doesn't build with node-gyp on Node 13 (macOS Catalina), excerpt from build below:

Library/Caches/node-gyp/13.1.0/include/node/v8.h:3427:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
../src/fibers.cc:927:27: error: no matching member function for call to 'Get'
        if (did_init || !target->Get(uni::NewLatin1Symbol(isolate, "Fiber"))->IsUndefined()) {
                         ~~~~~~~~^~~
/Users/blackxored/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3471:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/blackxored/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3474:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
../src/fibers.cc:206:25: error: no matching member function for call to 'Set'
                info.GetReturnValue().Set(handle);
                ~~~~~~~~~~~~~~~~~~~~~~^~~
../src/fibers.cc:838:17: note: in instantiation of function template specialization 'uni::Return<v8::Object>' requested here
                                return uni::Return(current->handle, info);
                                            ^
/Users/blackxored/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3972:18: note: candidate function not viable: no known conversion from 'Persistent<v8::Object>' to 'bool' for 1st argument
  V8_INLINE void Set(bool value);
                 ^
/Users/blackxored/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3973:18: note: candidate function not viable: no known conversion from 'Persistent<v8::Object>' to 'double' for 1st argument
  V8_INLINE void Set(double i);
                 ^
/Users/blackxored/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3974:18: note: candidate function not viable: no known conversion from 'Persistent<v8::Object>' to 'int32_t' (aka 'int') for 1st argument
  V8_INLINE void Set(int32_t i);
                 ^
/Users/blackxored/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3975:18: note: candidate function not viable: no known conversion from 'Persistent<v8::Object>' to 'uint32_t' (aka 'unsigned int') for 1st argument
  V8_INLINE void Set(uint32_t i);
                 ^
/Users/blackxored/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3966:18: note: candidate template ignored: could not match 'Global' against 'Persistent'
  V8_INLINE void Set(const Global<S>& handle);
                 ^
/Users/blackxored/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3968:18: note: candidate template ignored: could not match 'TracedGlobal' against 'Persistent'
  V8_INLINE void Set(const TracedGlobal<S>& handle);
                 ^
/Users/blackxored/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3970:18: note: candidate template ignored: could not match 'Local' against 'Persistent'
  V8_INLINE void Set(const Local<S> handle);
                 ^
/Users/blackxored/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3985:18: note: candidate template ignored: could not match 'S *' against 'Persistent<v8::Object>'
  V8_INLINE void Set(S* whatever);
davegregg commented 4 years ago

+1 Same issue. It's preventing Gatsby from building on Node 13.

garyo commented 4 years ago

+1 same for me. Can't build w/ node 13 on MacOS. Downgrading node to 10.17 works. Error is similar:

error /Users/garyo/dss/product/Horizon/horizon-project/node_modules/fibers: Command failed.
Exit code: 127
Command: node build.js || nodejs build.js
Arguments: 
Directory: /Users/garyo/dss/product/Horizon/horizon-project/node_modules/fibers
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@13.2.0 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/usr/local/Cellar/node/13.2.0/libexec/lib/node_modules/npm/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   '/Users/garyo/dss/product/Horizon/horizon-project/node_modules/fibers/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/Cellar/node/13.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/garyo/Library/Caches/node-gyp/13.2.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/garyo/Library/Caches/node-gyp/13.2.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/Cellar/node/13.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/garyo/Library/Caches/node-gyp/13.2.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/garyo/dss/product/Horizon/horizon-project/node_modules/fibers',
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' ]
../src/fibers.cc:899:12: error: no matching member function for call to 'Set'
                        target->Set(sym_yield, yield);
                        ~~~~~~~~^~~
/Users/garyo/Library/Caches/node-gyp/13.2.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
...
laverdet commented 4 years ago

you guys need to upgrade fibers

notjames commented 4 years ago

Sorry to "reopen" this thread. I've done the following: Upgraded node (13.7.0), node-gyp (6.1.0), and fibers (4.0.3) and I'm still getting the exact same error as above:

$ node /Users/user/projects/src/ims-frontend/node_modules/fibers/build
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@13.7.0 | darwin | x64
gyp info find Python using Python version 2.7.17 found at "/usr/local/opt/python@2/bin/python2.7"
gyp info spawn /usr/local/opt/python@2/bin/python2.7
gyp info spawn args [
gyp info spawn args   '/usr/local/lib/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   '/Users/user/projects/src/ims-frontend/node_modules/fibers/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/user/Library/Caches/node-gyp/13.7.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/user/Library/Caches/node-gyp/13.7.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/user/Library/Caches/node-gyp/13.7.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/user/projects/src/ims-frontend/node_modules/fibers',
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' ]
  CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc:899:12: error: no matching member function for call to 'Set'
                        target->Set(sym_yield, yield);
                        ~~~~~~~~^~~
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:3550:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
../src/fibers.cc:903:8: error: no matching member function for call to 'Set'
                        fn->Set(sym_yield, yield);
                        ~~~~^~~
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:3550:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
../src/fibers.cc:909:12: error: no matching member function for call to 'Set'
                        target->Set(uni::NewLatin1Symbol(isolate, "Fiber"), fn);
                        ~~~~~~~~^~~
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:3550:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
../src/fibers.cc:927:27: error: no matching member function for call to 'Get'
        if (did_init || !target->Get(uni::NewLatin1Symbol(isolate, "Fiber"))->IsUndefined()) {
                         ~~~~~~~~^~~
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:3594:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:3597:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
../src/fibers.cc:206:25: error: no matching member function for call to 'Set'
                info.GetReturnValue().Set(handle);
                ~~~~~~~~~~~~~~~~~~~~~~^~~
../src/fibers.cc:838:17: note: in instantiation of function template specialization 'uni::Return<v8::Object>' requested here
                                return uni::Return(current->handle, info);
                                            ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:4096:18: note: candidate function not viable: no known conversion from 'Persistent<v8::Object>' to 'bool' for 1st argument
  V8_INLINE void Set(bool value);
                 ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:4097:18: note: candidate function not viable: no known conversion from 'Persistent<v8::Object>' to 'double' for 1st argument
  V8_INLINE void Set(double i);
                 ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:4098:18: note: candidate function not viable: no known conversion from 'Persistent<v8::Object>' to 'int32_t' (aka 'int') for 1st argument
  V8_INLINE void Set(int32_t i);
                 ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:4099:18: note: candidate function not viable: no known conversion from 'Persistent<v8::Object>' to 'uint32_t' (aka 'unsigned int') for 1st argument
  V8_INLINE void Set(uint32_t i);
                 ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:4090:18: note: candidate template ignored: could not match 'Global' against 'Persistent'
  V8_INLINE void Set(const Global<S>& handle);
                 ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:4092:18: note: candidate template ignored: could not match 'TracedReferenceBase' against 'Persistent'
  V8_INLINE void Set(const TracedReferenceBase<S>& handle);
                 ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:4094:18: note: candidate template ignored: could not match 'Local' against 'Persistent'
  V8_INLINE void Set(const Local<S> handle);
                 ^
/Users/user/Library/Caches/node-gyp/13.7.0/include/node/v8.h:4109:18: note: candidate template ignored: could not match 'S *' against 'Persistent<v8::Object>'
  V8_INLINE void Set(S* whatever);
                 ^
5 errors generated.
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/Cellar/node/13.7.0/bin/node" "/usr/local/bin/node-gyp" "rebuild" "--release"
gyp ERR! cwd /Users/user/projects/src/ims-frontend/node_modules/fibers
gyp ERR! node -v v13.7.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok 
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'` 
Alpine users please run: `sudo apk add python make g++`

Any other thoughts as to what might be the problem?

laverdet commented 4 years ago

@notjames something has gone wrong during your upgrade. Take a look at your error

../src/fibers.cc:899:12: error: no matching member function for call to 'Set'
                        target->Set(sym_yield, yield);
                        ~~~~~~~~^~~

That doesn't match the source tree: https://github.com/laverdet/node-fibers/blob/4b9fcc9df759a043cfefc1687c051d22c1aee294/src/fibers.cc#L898-L900

notjames commented 4 years ago

hmm. That's weird! I even uninstalled (via npm (-g and ! -g)) and then installed via git given the instructions (https://github.com/laverdet/node-fibers) under "from source."

I'll dig a bit and see if I can figure out what happened. I'm not familiar with npm et al so I'm getting up to speed on this stuff.