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

Cannot install nodegit on linux machines (e.g. travis builds) #853

Closed
runspired opened this Issue Jan 6, 2016 · 19 comments

Comments

Projects
None yet
@runspired
Copy link

runspired commented Jan 6, 2016

/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/travis/build/runspired/ember-cli-changelog/node_modules/nodegit/build/Release/nodegit.node)
@runspired

This comment has been minimized.

Copy link

runspired commented Jan 6, 2016

Probably a duplicate: #758 (comment)

@runspired

This comment has been minimized.

Copy link

runspired commented Jan 6, 2016

An incorrectly closed PR which assumed this issue was no longer present: #744

@tbranyen

This comment has been minimized.

Copy link
Member

tbranyen commented Jan 6, 2016

We're still linking our prebuilts to a newer gcc. If you build it from source it should work fine. Try:

BUILD_ONLY=true npm install nodegit
@runspired

This comment has been minimized.

Copy link

runspired commented Jan 6, 2016

I was able to get the project directly consuming it to build (both with and without master) by following the travis-addon instructions in the above PR.

However, setting the dependency to master results in failed builds for projects consuming another project which has nodegit as a dependency.

See: https://travis-ci.org/runspired/ember-hammertime/jobs/100523335

@johnhaley81

This comment has been minimized.

Copy link
Member

johnhaley81 commented Jan 6, 2016

You're getting a node-gyp error because that build is still using old gcc.

We might need to make gcc 4.9+ a requirement for nan anyways since for node versions 4+

@runspired

This comment has been minimized.

Copy link

runspired commented Jan 6, 2016

@johnhaley81 I did, I can make Travis pass for that repo (and that repo only) with each test scenario taking an additional 6-10minutes to run :'(

But a secondary issue arises when that repo is a dependency of another project. It's code will never be executed on Travis, but nodegit must be a dependency. This results in consuming projects also needing to configure Travis specially for a dependency that's unneeded during testing, with ridiculous build times if you do.

@amackera

This comment has been minimized.

Copy link

amackera commented Jan 12, 2016

I'm also seeing this error trying to run a project using nodegit in Elastic Beanstalk.

@thinkingmedia

This comment has been minimized.

Copy link

thinkingmedia commented Jan 13, 2016

I can confirm this is still an issue with 0.7.0 build.

@tbranyen

This comment has been minimized.

Copy link
Member

tbranyen commented Jan 13, 2016

@runspired if you setup your travis env to use the latest gcc 4.9, you shouldn't have to compile anything to make this work and your builds should take hardly any longer.

@tbranyen

This comment has been minimized.

Copy link
Member

tbranyen commented Jan 15, 2016

I received this error myself when installing NodeGit on Ubuntu. So I followed my own advice above and installed both GCC 4.9 and the libstdc++-4.9-dev packages by doing:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install libstdc++-4.9-dev

Pre install libstdc++-4.9-dev linked libraries:

λ ldd node_modules/nodegit/build/Release/nodegit.node
node_modules/nodegit/build/Release/nodegit.node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node_modules/nodegit/build/Release/nodegit.node)
    linux-vdso.so.1 =>  (0x00007fffdabd5000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7309f02000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7309cec000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7309ace000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7309709000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7309403000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f730ad03000)

Post install libstdc++-4.9-dev linked libraries:

λ ldd node_modules/nodegit/build/Release/nodegit.node 
    linux-vdso.so.1 =>  (0x00007ffe26c6a000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4d5b9ea000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4d5b7cc000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4d5b407000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4d5b101000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f4d5c46a000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4d5aeeb000)

So yes, you'll definitely need to install libstdc++-4.9-dev if it's not working out-of-the-box.

@tbranyen

This comment has been minimized.

Copy link
Member

tbranyen commented Jan 15, 2016

You can do this in Travis-CI by adding the following to your .travis.yml file:

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - libstdc++-4.9-dev

@tbranyen tbranyen closed this Jan 15, 2016

mrPjer added a commit to mrPjer/git-hours that referenced this issue Feb 7, 2016

Install libstdc++ when testing on Travis
Found on [1]. Fixes the error [2] when running a build on Travis CI.

[1] nodegit/nodegit#853
[2] Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
`GLIBCXX_3.4.20' not found (required by
/home/travis/build/kimmobrunfeldt/git-hours/node_modules/nodegit/build/Release/nodegit.node)
@hridyeshpant

This comment has been minimized.

Copy link

hridyeshpant commented May 17, 2016

we are also hitting same issue

Error: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /data/jenkins/workspace/master/node_modules/nodegit/build/Release/nodegit.node)

Is there any solution for centos-release-6-7 OS?

@semos

This comment has been minimized.

Copy link

semos commented May 31, 2016

@hridyeshpant any solutions on this ?

@mikalai-silivonik

This comment has been minimized.

Copy link

mikalai-silivonik commented Oct 17, 2016

Is there any solution for centos-release-6-7 OS?

BUILD_ONLY=true npm install nodegit solved the problem for me on centos7. Thanks to #853 (comment)

@heath-guidewire

This comment has been minimized.

Copy link

heath-guidewire commented Apr 21, 2017

Is BUILD_ONLY=true npm install nodegit the same as npm install nodegit --build-from-source?

@maxkorp

This comment has been minimized.

Copy link
Member

maxkorp commented Apr 21, 2017

Not quite, there is a bit more to it that we do with BUILD_ONLY set to true

@chalangr12

This comment has been minimized.

Copy link

chalangr12 commented May 2, 2017

So what's the solution for this? I'm trying to run a project on elasticbeanstalk and it's failing with the same issues.

@tbranyen

This comment has been minimized.

Copy link
Member

tbranyen commented May 2, 2017

@chalangr12 solution for what? We can't build for every single architecture unfortunately, only popular ones. Can you try and suss out what dependency is causing your failure? Is it glibc?

@ghost

This comment has been minimized.

Copy link

ghost commented May 16, 2017

i think the issue people are running into is that on centos at least libstdc++-4.9 isn't in the normal repos

travi added a commit to travi/cli that referenced this issue Apr 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment