mapbox / node-or-tools

Node.js bindings for or-tools vehicle routing problems
MIT License
147 stars 48 forks source link

Add Node.js 10.x builds #62

Closed danpaz closed 5 years ago

danpaz commented 6 years ago

Node.js 10.x entered active LTS today, adding builds to Travis to publish binaries for node 10.

danpaz commented 5 years ago

Something about the build script is broken and haven't got to the bottom of it. Only the node 10 builds are failing on Travis, but that's only because node 4,6,8 builds are already available so no rebuilding occurs. Building locally with npm install --build-from-source fails for me on node v8.11.3 as well as v10.13.0.

This error is on CI only - I don't see it locally:

./scripts/install-deps.sh: line 24: ./third_party/mason/mason: No such file or directory

The error appears to be internal to node-pre-gyp and I do see it locally as well:

make: *** [mason_packages] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/travis/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/Users/travis/.nvm/versions/node/v10.13.0/bin/node" "/Users/travis/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/travis/build/mapbox/node-or-tools/lib/binding/node_or_tools.node" "--module_name=node_or_tools" "--module_path=/Users/travis/build/mapbox/node-or-tools/lib/binding" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /Users/travis/build/mapbox/node-or-tools
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/travis/.nvm/versions/node/v10.13.0/bin/node /Users/travis/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/travis/build/mapbox/node-or-tools/lib/binding/node_or_tools.node --module_name=node_or_tools --module_path=/Users/travis/build/mapbox/node-or-tools/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/travis/build/mapbox/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:962:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Darwin 17.4.0
node-pre-gyp ERR! command "/Users/travis/.nvm/versions/node/v10.13.0/bin/node" "/Users/travis/build/mapbox/node-or-tools/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/travis/build/mapbox/node-or-tools
node-pre-gyp ERR! node -v v10.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok 
Failed to execute '/Users/travis/.nvm/versions/node/v10.13.0/bin/node /Users/travis/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/travis/build/mapbox/node-or-tools/lib/binding/node_or_tools.node --module_name=node_or_tools --module_path=/Users/travis/build/mapbox/node-or-tools/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node_or_tools@1.0.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node_or_tools@1.0.6 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/travis/.npm/_logs/2018-11-26T23_18_02_137Z-debug.log

/cc @daniel-j-h does anything about this error stick out to you?

springmeyer commented 5 years ago

@danpaz I noticed this PR and poked at the node v10 failure. I think what is happening is that curl is broken for node v10. One explanation for this would be that something in npm or node (which are being used to run the install-deps.sh script) is setting an environment variable that breaks curl. Maybe something to do with SSL or something - I don't know. But I did confirm that installing mason via curl before (or outside) of the npm install seems to work: https://github.com/mapbox/node-or-tools/compare/node-10-builds...upgrade-mason

danpaz commented 5 years ago

Thanks @springmeyer great find! If your branch upgrade-mason is working I'm inclined to merge it with this branch, the changes look good to me.

springmeyer commented 5 years ago

👍 @danpaz go ahead and merge if you'd like.

ivosabev commented 5 years ago

Is this going to be merged soon? Also please check https://github.com/mapbox/node-or-tools/pull/66 as it fixes manual builds.

coderroggie commented 5 years ago

Any chance this might be merged soon?