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

Native gems: centos6 support #2081

Closed
flavorjones opened this issue Sep 9, 2020 · 5 comments · Fixed by #2156
Closed

Native gems: centos6 support #2081

flavorjones opened this issue Sep 9, 2020 · 5 comments · Fixed by #2156

Comments

@flavorjones
Copy link
Member

flavorjones commented Sep 9, 2020

(Originally mentioned at #2075 (comment))

On Centos6, running a version of Ruby compiled like this, we see the following error message when loading the nokogiri.so shared library:

/lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri/2.6/nokogiri.so)

I'm not deeply familiar with our glibc requirements, but if we go back to the early days of Linux native gems, in #1571, @larskanis mentions that we need GLIBC 2.17 or later (and we check for this here).

It looks like CentOS/6.10 is based on glibc 2.12 which might explain why this isn't working -- but the error message is a little confusing if this is the case. @larskanis can you take a look and confirm my understanding?

To Reproduce

host $ docker pull registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/centos_6:0.0.72
...

host $ docker run -t registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/centos_6:0.0.72 /bin/bash

guest # gem install --prerelease nokogiri
Fetching: nokogiri-1.11.0.rc3-x86_64-linux.gem (100%)
Nokogiri is built with the packaged libraries: libxml2-2.9.10, libxslt-1.1.34, zlib-1.2.11, libiconv-1.15.
Successfully installed nokogiri-1.11.0.rc3-x86_64-linux
Parsing documentation for nokogiri-1.11.0.rc3-x86_64-linux
Installing ri documentation for nokogiri-1.11.0.rc3-x86_64-linux
Done installing documentation for nokogiri after 2 seconds
1 gem installed

guest # nokogiri -v
# nokogiri -v
Traceback (most recent call last):
	7: from /usr/local/bin/nokogiri:23:in `<main>'
	6: from /usr/local/bin/nokogiri:23:in `load'
	5: from /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/bin/nokogiri:6:in `<top (required)>'
	4: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	3: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	2: from /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri.rb:13:in `<top (required)>'
	1: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:55:in `require': /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri/2.6/nokogiri.so) - /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri/2.6/nokogiri.so (LoadError)
	8: from /usr/local/bin/nokogiri:23:in `<main>'
	7: from /usr/local/bin/nokogiri:23:in `load'
	6: from /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/bin/nokogiri:6:in `<top (required)>'
	5: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	4: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	3: from /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri.rb:11:in `<top (required)>'
	2: from /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri.rb:15:in `rescue in <top (required)>'
	1: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:55:in `require': libruby.so.2.5: cannot open shared object file: No such file or directory - /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri/nokogiri.so (LoadError)
@flavorjones
Copy link
Member Author

tagging @twk3 so he can follow along as the original reporter

@twk3
Copy link

twk3 commented Dec 29, 2020

Now that centos 6 has hit its EOL, this is likely isn't very important. We no longer ship centos 6 packages for GitLab (which is where I ran into this), so I am no longer in need of a fix.

@flavorjones
Copy link
Member Author

@twk3 Thanks for closing the loop here. I'd still like to see if we can make this fail a little more gracefully on systems with older glibc versions, so I'll leave it open until I can investigate.

@larskanis
Copy link
Member

I first used manylinux2010 for rake-compiler-dock-1.1.0 which produced a centos-6 compatible binary, but switched to manylinux2014 later on, since I don't think we want to support systems that are EOL.

Regarding the error message, I don't think it's too bad. I understood it at the very first reading.

flavorjones added a commit that referenced this issue Dec 31, 2020
Specifically, older systems may not meet our expectations for glibc,
and this commit attempts to help those poor souls find a path forward.

I manually tested this change using the OCI image at:

  registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/centos_6:0.0.72

Closes #2081
@flavorjones
Copy link
Member Author

I've created a PR at #2156 to try to be more helpful for folks who are in this situation. If they're used to Nokogiri "just working" on their system, they may not understand how to address the situation (even if they understand the exception message).

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

Successfully merging a pull request may close this issue.

3 participants