You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is, that nodegit wants libcurl abi-3, while archlinux default libcurl is abi-4.
How to fix
At least on arch-linux nodegit should link against libcurl-compat (which is abi-3 and provides libcurl.so.3as well as libcurl-compat.so), not libcurl (which is abi-4 and is incompatible with CURL_OPENSSL_3).
How to reproduce
Grab and boot a manjaro live-cd (https://manjaro.github.io/), which should be easier/faster then bootstrapping arch
Install nodejs with pacman/yaourt
Try to install nodegit with npm
Sidenote
Effected third-party tools are for example GitKraken on arch (see comments) which comes with prebuild nodegit binaries but fails to load because of missing/wrong symbols in libcurl.so.4. This can be fixed by loading libcurl-compat before libcurl using the LD_PRELOAD trick.
I don't think there is an easy solution for this, here is the package content for libcurl-compat while default libcurl comes from this package.
Side note
I actually think there might be something entirely different wrong here.
When running npm install nodegit in a fresh directory it terminates rather quickly with:
[<build>]$ npm install nodegit
> nodegit@0.17.0 install <build>/node_modules/nodegit
> node lifecycleScripts/preinstall && node lifecycleScripts/install
[nodegit] Running pre-install script
[nodegit] Configuring libssh2.
[nodegit] Running install script
[nodegit] Success: "<build>/node_modules/nodegit/build/Release/nodegit.node" is installed via remote
[nodegit] Completed installation successfully.
> nodegit@0.17.0 postinstall <build>/node_modules/nodegit
> node lifecycleScripts/postinstall
[nodegit] WARN - Could not finish postinstall
{ Error: Command failed: node "<build>/node_modules/nodegit/dist/nodegit.js"
<build>/node_modules/nodegit/dist/nodegit.js:15
throw ex;
^
Error: /usr/lib/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by <build>/node_modules/nodegit/build/Release/nodegit.node)
at Object.Module._extensions..node (module.js:598:18)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (<build>/node_modules/nodegit/dist/nodegit.js:11:12)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at ChildProcess.exithandler (child_process.js:211:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:192:7)
at maybeClose (internal/child_process.js:890:16)
at Socket.<anonymous> (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:189:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
killed: false,
code: 1,
signal: null,
cmd: 'node "<build>/node_modules/nodegit/dist/nodegit.js"' }
When I fetch nodegit manually from git, add the libgit2 repository to the vendor directory and run npm run rebuild from within, building succeeds, but interestingly it does take quiet a bit longer which I think has to be due to building libgit2.
Could it be that nodegit comes with a prebuild version of libgit2, which for some reason is build against libcurlABI 3; aka is linked against libcurl.so which is symlink for libcurl.so.3 and not libcurl.so.4 on that particiular system libcurl.so.4 which contains backwards compatiblity code for ABI 3.
Another clues that the issue might be with a prebuild library can be seen when running ldd nodegit.node against the version that was ...
[A] ...build via npm install nodegit, which may have been linked against a pre-build libgit2:
Both want to load libcurl.so.4 on my system, both were build by linking with -lcurl, but Exhibit A for some reason still has an undefined symbol.
There is also a difference in size, Exhibit A is rougly 6.3mb, while Exhibit B is rougly 7mb.
Conclusion
The issue seems to be with a prebuild library (probably libgit2) which was linked against libcurl -> libcurl.so.4 which also contained backwards compatible libcurl.so.3 code, while arch-linux libcurl.so.4 does not.
Proposed solution
Don't use prebuild libraries (on arch) IFF that is an option?
Yeah it's not that it's a prebuilt libgit2, its a prebuilt nodegit binary, which then fails to load. I think tin the case of arch, you'll need to run BUILD_ONLY=1 npm install nodegit, until we can figure out away around that.
Reacted by Clement134, Maxime Poulin, [object Object], Roberto Paredes, KillWolfVlad, Alexander Elias and Alexandr Shtromberg
Activity
saper commentedon Feb 26, 2017
Is there any way to detect this situation for example using
curl-config? Is there something likecurl-compat-configavailable?Hufschmidt commentedon Feb 27, 2017
I don't think there is an easy solution for this, here is the package content for libcurl-compat while default libcurl comes from this package.
Side note
I actually think there might be something entirely different wrong here.
When running
npm install nodegitin a fresh directory it terminates rather quickly with:When I fetch
nodegitmanually from git, add thelibgit2repository to thevendordirectory and runnpm run rebuildfrom within, building succeeds, but interestingly it does take quiet a bit longer which I think has to be due to buildinglibgit2.Could it be that
nodegitcomes with a prebuild version oflibgit2, which for some reason is build againstlibcurlABI 3; aka is linked againstlibcurl.sowhich is symlink forlibcurl.so.3 and not libcurl.so.4 on that particiular systemlibcurl.so.4 which contains backwards compatiblity code for ABI 3.Another clues that the issue might be with a prebuild library can be seen when running
ldd nodegit.nodeagainst the version that was ...npm install nodegit, which may have been linked against a pre-buildlibgit2:npm run rebuild:Both want to load libcurl.so.4 on my system, both were build by linking with
-lcurl, but Exhibit A for some reason still has an undefined symbol.There is also a difference in size, Exhibit A is rougly 6.3mb, while Exhibit B is rougly 7mb.
Conclusion
The issue seems to be with a prebuild library (probably
libgit2) which was linked against libcurl -> libcurl.so.4 which also contained backwards compatible libcurl.so.3 code, while arch-linux libcurl.so.4 does not.Proposed solution
Don't use prebuild libraries (on arch) IFF that is an option?
maxkorp commentedon Mar 1, 2017
Yeah it's not that it's a prebuilt libgit2, its a prebuilt nodegit binary, which then fails to load. I think tin the case of arch, you'll need to run
BUILD_ONLY=1 npm install nodegit, until we can figure out away around that.