nodegit: Failed to compile on Node 10.0.0
nodegit fails to compile on Node 10.0.0 and NPM 5.6.0. Here’s a way to reproduce the issue:
cd ~
mkdir test_repo
cd test_repo
npm init
npm i --save nodegit
Here are my logs:
https://gist.github.com/sadasant/4fce501d8cffda53bc8fb53f4950eaa3
Also happens with NPM 6.0.0:
https://gist.github.com/sadasant/cf598e5d232be909e426135a3de87847
May 1 update
Even though nodegit’s issue is deeper that what I’m about to mention, the following issue is the first breaking point for building nodegit on Node 10:
There was a recent change on Node 10’s Function’s toString method. Here’s an issue that I created: https://github.com/nodejs/node/issues/20459
This change in Node 10 causes promisify-node to break, here’s the relevant issue: https://github.com/nodegit/promisify-node/issues/28
May 2 update
The exception happens when we try to run node node_modules/.bin/node-pre-gyp install --build-from-source
. The issue seems to be that libssh2 is expected to be built using openssl-0.9.8: https://github.com/libssh2/libssh2/search?utf8=✓&q=openssl-0.9.8&type= However, node 10 moved openssl forward to 1.1.0: https://github.com/nodejs/node/search?utf8=✓&q=OpenSSL+has+been+updated+to+1.1.0h.&type=
Here are my logs: https://gist.github.com/sadasant/031d3f8bf1c4e5d2ac83b3841b7807fc
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 29
- Comments: 29 (14 by maintainers)
Commits related to this issue
- ci: for the time being, latest node build are deactivated This issue is related to the dependency nodegit. Related issue is https://github.com/nodegit/nodegit/issues/1490 — committed to MartinHelmut/berries by MartinHelmut 6 years ago
- ci: for the time being, latest node build are deactivated This issue is related to the dependency nodegit. Related issue is https://github.com/nodegit/nodegit/issues/1490 — committed to MartinHelmut/berries by MartinHelmut 6 years ago
- Patch LockMasterSetStatus See https://github.com/nodegit/nodegit/issues/1490#issuecomment-422941369 Co-Authored-By: Mehdi Yeganeh <myeganeh1984@gmail.com> — committed to Croydon/nodegit by Croydon 6 years ago
- Patch LockMasterSetStatus See https://github.com/nodegit/nodegit/issues/1490#issuecomment-422941369 Co-Authored-By: Mehdi Yeganeh <myeganeh1984@gmail.com> — committed to Croydon/nodegit by Croydon 6 years ago
- Patch LockMasterSetStatus See https://github.com/nodegit/nodegit/issues/1490#issuecomment-422941369 Co-Authored-By: Mehdi Yeganeh <myeganeh1984@gmail.com> — committed to Croydon/nodegit by Croydon 6 years ago
- Patch LockMasterSetStatus See https://github.com/nodegit/nodegit/issues/1490#issuecomment-422941369 Co-Authored-By: Mehdi Yeganeh <myeganeh1984@gmail.com> — committed to Croydon/nodegit by Croydon 6 years ago
- Patch LockMasterSetStatus See https://github.com/nodegit/nodegit/issues/1490#issuecomment-422941369 Co-Authored-By: Mehdi Yeganeh <myeganeh1984@gmail.com> — committed to Croydon/nodegit by Croydon 6 years ago
- Patch LockMasterSetStatus See https://github.com/nodegit/nodegit/issues/1490#issuecomment-422941369 Co-Authored-By: Mehdi Yeganeh <myeganeh1984@gmail.com> — committed to Croydon/nodegit by Croydon 6 years ago
- Patch LockMasterSetStatus See https://github.com/nodegit/nodegit/issues/1490#issuecomment-422941369 Co-Authored-By: Mehdi Yeganeh <myeganeh1984@gmail.com> — committed to Croydon/nodegit by Croydon 6 years ago
- ci: for the time being, latest node build are deactivated This issue is related to the dependency nodegit. Related issue is https://github.com/nodegit/nodegit/issues/1490 — committed to MartinHelmut/berries by MartinHelmut 6 years ago
Many of us have upgraded to node10 and now this is a huge blocker. Please increase the priority of fixing this build failure.
👍 👍 👍 👍 👍
Instruction of building nodegit with node 10.10.0: (I hope its be useful)
Pre build: You should know enough about building nodegit in previous node versions and before building node git you should install some dependencies like node-gyp, node-pre-gyp, some crypt library and …
Build:
npm install
+1
Testing this out, and if true, I’ll ensure it gets merged today.
libssh2 should build fine with nodegit’s bundled OpenSSL 1.0.2.
However with Node 10 and OpenSSL 1.1.0, the build system fails to pick up the bundled OpenSSL 1.0.2 headers when building libssh2, and ends up using node-gyp’s OpenSSL 1.1.0 headers in ~/.node-gyp/10.1.0/include/node/openssl. This is because node-gyp seems to prepend
-I $(HOME)/.node-gyp/10.1.0/include/node
to the CFLAGS when building, ignoring the-I ../vendor/openssl/openssl/include
added by the nodegit build system.If we could somehow instruct node-gyp to actually prepend
-I ../vendor/openssl/openssl/include
to the include dirs, before-I $(HOME)/.node-gyp/…
, then libssh2 would pick up the compatible 1.0.2 headers. However I tried withinclude_dirs+
as suggested in the node-gyp reference, without luck. 😦For the libssh2 part an upgrade to version 1.8.0 of the library should fix it. That version is listed on their site and is tagged in github, but it doesn’t have a github release for some reason.