-
-
Notifications
You must be signed in to change notification settings - Fork 905
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
Feedback and final to-do items for precompiled native gems on Linux and OSX #2075
Comments
Unfortunately my system seems to be building the native extensions still:
I'm on macOS Catalina (10.15). My Ruby / Rubygems version (via Rbenv):
I noticed on Rubygems.org that RC3 only has |
@odlp - Thanks for giving it a try! I'm not building darwin18 gems at this point, because I don't have a system available to do so. Only darwin19 is supported right now. (But I have an old Mac Mini sitting around, maybe I'll use that for darwin18!) |
@flavorjones thanks for clarifying! Thanks for all this work on precompiled Nokogiri, it's an awesome improvement. Happy thought: I wonder how many tons of CO2 this'll save per year 😃 |
macOS Catalina (10.15.6)
|
On MacOS 10.15.6, ruby 2.6.6 Installs fine. Ran tests in one app and two gems I work on, tests green in all of them. |
Quick feedback:
I will investigate more on the JRuby failures. Thanks for your work on accelerating the installation, much appreciated! |
@thbar Thanks for testing this. If you need to, please open a new GH issue for the jruby problems -- I don't think they're going to be related to the native gem work for Linux and OSX. I'd like to know more about what you're seeing, though! |
Works perfectly on linux x86_64 (click for logs)
|
Its not happy on centos6, ruby 2.6 $ ldd /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri/nokogiri.so
/usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri/nokogiri.so: /lib64/libz.so.1: version `ZLIB_1.2.3.3' not found (required by /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri/nokogiri.so)
/usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri/nokogiri.so: /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/nokogiri.so)
/usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri/nokogiri.so: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.0.rc3-x86_64-linux/lib/nokogiri/nokogiri.so)
linux-vdso.so.1 => (0x00007ffc61dd8000)
libruby.so.2.5 => not found
libm.so.6 => /lib64/libm.so.6 (0x00007f64d7b0f000)
libz.so.1 => /lib64/libz.so.1 (0x00007f64d78f9000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f64d76dc000)
libc.so.6 => /lib64/libc.so.6 (0x00007f64d7348000)
/lib64/ld-linux-x86-64.so.2 (0x00007f64d81c5000) I have the newer zlib in |
@twk3 Interesting! Thank you for reporting this, I'll take a look. |
@twk3 How did you compile/build/install that version of Ruby? Looks like |
@flavorjones compiled from source, can be seen here: https://gitlab.com/gitlab-org/gitlab-omnibus-builder/-/blob/5523332b2cd3a14b4f4a4aa2b215465499ea3617/docker/Dockerfile_centos_6#L85 That environment can be pulled using docker at: |
Any chance you can release a 1.11 rc version that works with ruby 3.0 preview? I'm getting this when I try to use
|
@bruno- I'll look into it this week. |
@bruno- Please note that I've opened an upstream Bundler issue (rubygems/rubygems#4012) for this behavior. And I'm going to do my best to cut a native gem that's compatible with Ruby 3.0 in the next release candidate. |
This issue exists to capture feedback and action items about the precompiled native gems for Linux and OSX that we're shipping in the Nokogiri v1.11 release candidates (prereleases).
(RC4 is out! https://github.com/sparklemotion/nokogiri/releases/tag/v1.11.0.rc4)
How do I try this out?
We're only shipping native gems for the following platforms (run
bundle platform
orruby -e 'puts Gem::Platform.local.to_s'
to identify your system):x86_64-darwin
andarm64-darwin
x86-linux
andx86_64-linux
including musl platforms like alpinex86-mingw32
andx64-mingw32
java
If you're on Linux or OSX, try updating your Gemfile with:
If you're having trouble with bundler trying to install a native gem and it failing, you may want to set the
specific_platform
bundler config as described inbundler install
should not fail when a native platform gem's required_ruby_version is not met, and a suitableruby
platform gem is available · Issue #4012 · rubygems/rubygems:Please let us know how it works for you in the comments!
Known Issues
Providing Feedback
If you love this idea in a vague general sense, please give this comment a ❤️.
If you tried native gems on Linux or OSX and they worked just fine, please give this comment a 👍.
If you're having problems installing or using Nokogiri's precompiled native gems, please comment on this issue with the following information:
ruby -v
gem -v
gem env
bundle version
bundle config
(take care to redact any personal info or credentials)gem install
orbundle install
, including the command you ranWhy is a precompiled native gem useful?
Installing a precompiled native gem, installation takes about 1 second, and avoids the challenging bits of how to set up the compiler toolchain on your development system. This will reduce the support burden for Team Nokogiri and allow us to move a bit faster on bugfixes and features.
For comparison, compiling and installing the gem (and its vendored dependencies) from source, when only using a single core, my laptop takes 52 seconds. When using all 8 cores, this is cut down to 32 seconds.
Why would I not want to use a precompiled native gem?
I can imagine some folks might have trust issues; if this is you, please let us know in a comment here (or in #2013) what we could do to increase that trust (e.g., I can imagine providing a chain of custody including public build logs with cryptographic hashes of artifacts).
Anybody on a linux system old enough to not have glibc >= 2.17 will need to install (via compilation) from the
ruby
platform gem.If you have other reasons for not wanting to use a precompiled native gem, let us know in the comments.
How can I avoid using a precompiled native gem?
If you want to avoid using a precompiled gem in your project, do one of the following:
gem install nokogiri -v 1.11.0.rc4 --platform=ruby
bundle config set force_ruby_platform true
and you'll never use a precompiled native gemShout-outs
Thanks to @larskanis for all the time he spends maintaining the gems
rake-compiler
andrake-compiler-dock
, and for being the one who wrote the first PR for Linux native gem support.Thanks to the GRPC team who already ships native gems (see https://github.com/grpc/grpc). They blazed the trail and provided inspiration and a how-to manual for some edge cases.
Thanks to @tenderlove who paired with me on the nasty OSX bits that I was struggling with.
Resources
The text was updated successfully, but these errors were encountered: