Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Node 10.+ #54

Closed
ntelkedzhiev opened this issue May 28, 2018 · 12 comments
Closed

Compatibility with Node 10.+ #54

ntelkedzhiev opened this issue May 28, 2018 · 12 comments

Comments

@ntelkedzhiev
Copy link

Had to downgrade to Node.js 9.7.1 to make it work...

@daniel-j-h
Copy link
Contributor

What errors did you see? Can you provide more details?

We currently provide pre-built packages on npm for Node 4, 6, 8. If you want to add support for Node 10 you can modify the .travis.yaml file and open a pull request. Happy to review and merge it.

@ntelkedzhiev
Copy link
Author

Will do. Thanks 👍

@nnnikolay
Copy link

nnnikolay commented Jun 8, 2018

Hey, @daniel-j-h I'm not sure if this connected with node 10 (in my case 10.3.0) or not, but can't install the module, am I doing something wrong?

$ npm i node_or_tools --save

> [email protected] install /Users/n/Projects/sandbox/ren/node_modules/node_or_tools
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/node_or_tools/v1.0.5/Release/node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/node_or_tools/v1.0.5/Release/node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp)
  ACTION binding_gyp_action_before_build_target_install_deps mason_packages
  ACTION binding_gyp_action_before_build_target_install_deps mason_packages
Downloading Mason @ca9b4cb
Downloading Mason @ca9b4cb
* Downloading binary package osx-x86_64/protobuf/3.0.0.tar.gz...
fatal: Unable to read current working directory: No such file or directory
make: *** [mason_packages] Error 128
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/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/Cellar/node/10.3.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/lib/binding/node_or_tools.node" "--module_name=node_or_tools" "--module_path=/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/lib/binding"
gyp ERR! cwd /Users/n/Projects/sandbox/ren/node_modules/node_or_tools
gyp ERR! node -v v10.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
* Installed binary package at /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/osx-x86_64/protobuf/3.0.0
* Linking /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/osx-x86_64/protobuf/3.0.0
* Links will be inside /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/.link/
* Using bash fallback for symlinking (install lndir for faster symlinking)
* Done linking /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/osx-x86_64/protobuf/3.0.0
* Downloading binary package headers/sparsehash/2.0.2.tar.gz...
* Installed binary package at /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/headers/sparsehash/2.0.2
* Linking /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/headers/sparsehash/2.0.2
* Links will be inside /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/.link/
* Using bash fallback for symlinking (install lndir for faster symlinking)
* Done linking /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/headers/sparsehash/2.0.2
* Downloading binary package osx-x86_64/gflags/2.1.2.tar.gz...
* Installed binary package at /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/osx-x86_64/gflags/2.1.2
* Linking /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/osx-x86_64/gflags/2.1.2
* Links will be inside /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/.link/
* Using bash fallback for symlinking (install lndir for faster symlinking)
* Done linking /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/osx-x86_64/gflags/2.1.2
* Downloading binary package osx-x86_64/or-tools/6.0.tar.gz...
* Installed binary package at /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/osx-x86_64/or-tools/6.0
* Linking /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/osx-x86_64/or-tools/6.0
* Links will be inside /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/.link/
* Using bash fallback for symlinking (install lndir for faster symlinking)
* Done linking /Users/n/Projects/sandbox/ren/node_modules/node_or_tools/mason_packages/osx-x86_64/or-tools/6.0
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: unrecognized option: --strip-unneeded
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip [-AnuSXx] [-] [-d filename] [-s filename] [-R filename] [-o output] file [...]
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: unrecognized option: --strip-unneeded
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip [-AnuSXx] [-] [-d filename] [-s filename] [-R filename] [-o output] file [...]
  TOUCH Release/obj.target/action_before_build.stamp
  CXX(target) Release/obj.target/node_or_tools/src/main.o
In file included from ../src/main.cc:1:
In file included from ../src/tsp.h:6:
../src/adaptors.h:39:28: warning: 'Call' is deprecated [-Wdeprecated-declarations]
      auto cost = callback.Call(argc, argv);
                           ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
In file included from ../src/main.cc:1:
In file included from ../src/tsp.h:6:
../src/adaptors.h:64:30: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    auto interval = callback.Call(argc, argv);
                             ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
In file included from ../src/main.cc:1:
In file included from ../src/tsp.h:6:
../src/adaptors.h:102:27: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    auto locks = callback.Call(argc, argv);
                          ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
3 warnings generated.
  CXX(target) Release/obj.target/node_or_tools/src/tsp.o
In file included from ../src/tsp.cc:1:
In file included from ../src/tsp.h:6:
../src/adaptors.h:39:28: warning: 'Call' is deprecated [-Wdeprecated-declarations]
      auto cost = callback.Call(argc, argv);
                           ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
In file included from ../src/tsp.cc:1:
In file included from ../src/tsp.h:6:
../src/adaptors.h:64:30: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    auto interval = callback.Call(argc, argv);
                             ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
In file included from ../src/tsp.cc:1:
In file included from ../src/tsp.h:6:
../src/adaptors.h:102:27: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    auto locks = callback.Call(argc, argv);
                          ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
In file included from ../src/tsp.cc:3:
../src/tsp_worker.h:52:15: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    callback->Call(argc, argv);
              ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/tsp.cc:31:37: error: no matching member function for call to 'NewInstance'
    info.GetReturnValue().Set(init->NewInstance());
                              ~~~~~~^~~~~~~~~~~
/Users/n/.node-gyp/10.3.0/include/node/v8.h:3862:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
/Users/n/.node-gyp/10.3.0/include/node/v8.h:3859:44: note: candidate function not viable: requires 3 arguments, but 0 were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
4 warnings and 1 error generated.
make: *** [Release/obj.target/node_or_tools/src/tsp.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/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/Cellar/node/10.3.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/lib/binding/node_or_tools.node" "--module_name=node_or_tools" "--module_path=/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/lib/binding"
gyp ERR! cwd /Users/n/Projects/sandbox/ren/node_modules/node_or_tools
gyp ERR! node -v v10.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/10.3.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/lib/binding/node_or_tools.node --module_name=node_or_tools --module_path=/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/lib/binding' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Darwin 17.5.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/10.3.0/bin/node" "/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/n/Projects/sandbox/ren/node_modules/node_or_tools
node-pre-gyp ERR! node -v v10.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/10.3.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/lib/binding/node_or_tools.node --module_name=node_or_tools --module_path=/Users/n/Projects/sandbox/ren/node_modules/node_or_tools/lib/binding' (1)
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/n/.npm/_logs/2018-06-08T08_41_17_282Z-debug.log

Don't I have any -dev package system-wide?

@daniel-j-h
Copy link
Contributor

Seems like this is a breaking change in the v8 API

../src/tsp.cc:31:37: error: no matching member function for call to 'NewInstance'
    info.GetReturnValue().Set(init->NewInstance());
                              ~~~~~~^~~~~~~~~~~

coming from

You can simply remove the branches for now and re-compile.

@nnnikolay
Copy link

@daniel-j-h sorry Daniel, what branches are you talking about?

@daniel-j-h
Copy link
Contributor

In tsp.cc and vrp.cc remove

node-or-tools/src/tsp.cc

Lines 28 to 33 in 30351e1

// Handle `new T()` as well as `T()`
if (!info.IsConstructCall()) {
auto init = Nan::New(constructor());
info.GetReturnValue().Set(init->NewInstance());
return;
}

and

node-or-tools/src/vrp.cc

Lines 27 to 32 in 30351e1

// Handle `new T()` as well as `T()`
if (!info.IsConstructCall()) {
auto init = Nan::New(constructor());
info.GetReturnValue().Set(init->NewInstance());
return;
}

The NewInstance function calls seem to be not compatible with newer v8 versions.

@ivosabev
Copy link
Contributor

Is this fix going to be release officially?

@daniel-j-h
Copy link
Contributor

Happy to review a pull request if you want to help out here. It's not as easy as removing the two branches above as it will break compatibility with user code. But otherwise there should be nothing blocking this.

@ivosabev
Copy link
Contributor

ivosabev commented Oct 2, 2018

I have submitted a PR that I believe should fix the issue and preserve compatibility.

#57

@daniel-j-h
Copy link
Contributor

Thanks! I merged your pull request, released v1.0.6. Travis automatically built binaries for LTS Node 4,6,8.

@danpaz
Copy link
Contributor

danpaz commented Nov 27, 2018

@ivosabev have you been able to produce a build for node 10? I've been running into issues building in #62 although not much has changed since your PR #57.

@ivosabev
Copy link
Contributor

ivosabev commented Nov 28, 2018

@danpaz I was able to build it, but only in a fresh directory without any other dependencies in the package.json. If I try to build it from my project folder it calls twice mason and runs two concurrent builds resulting in a failure. I've described it in #59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants