-
-
Notifications
You must be signed in to change notification settings - Fork 899
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
[install] OpenBSD: Failed to build gem native extension on Ruby 3.0.3 #2487
Comments
@basicfeatures Thanks for opening this issue! I'll circle back later today, I have a good idea of why this is happening but lack the time right now to dig in. I have some free time in the afternoon. |
@flavorjones Hi! Totally understand what you mean by lack of time. However, any chance you could give me any pointers as to what you think might be wrong, so I could try look into it myself first? |
@basicfeatures Sorry for the delay in replying. What I thought I remembered was incorrect (Ruby 3.1 changed some of the behavior of pkg-config, but you're on Ruby 3.0.3). I looked this morning and this seems like it's just a bug in Nokogiri's extconf.rb that handles a rare edge case when libiconv can't be found. Some things to try:
On my side, I'll try to configure an OpenBSD virtual machine to try to reproduce this and fix the bug. |
@basicfeatures I am able to reproduce what you see if I don't have I'll also fix this issue in the extconf.rb file. |
instead of a syntax error from extconf.rb Fixes #2487
@flavorjones Greetings and thanks so much for getting back at me! Sadly though, the issue is still the same with regards to the If you have both rubies installed, be sure to add the symlinks from the post-install notice:
|
@basicfeatures Do you mean you get the same error message? I'm not able to reproduce using the openbsd7 vagrant image and ruby-3.0.3 if I have installed libiconv. How can I reproduce what you're seeing? |
Hi there! Yep, same thing unfortunately. Here are my exact steps on a fresh new OpenBSD 7.0 cloud instance if you'd like to try to reproduce: % pkg_add ruby node sass zsh libiconv
% ln -sf /usr/local/bin/ruby30 /usr/local/bin/ruby
% ln -sf /usr/local/bin/erb30 /usr/local/bin/erb
% ln -sf /usr/local/bin/irb30 /usr/local/bin/irb
% ln -sf /usr/local/bin/rdoc30 /usr/local/bin/racc
% ln -sf /usr/local/bin/rdoc30 /usr/local/bin/rdoc
% ln -sf /usr/local/bin/rdoc30 /usr/local/bin/rbs
% ln -sf /usr/local/bin/ri30 /usr/local/bin/ri
% ln -sf /usr/local/bin/rake30 /usr/local/bin/rake
% ln -sf /usr/local/bin/gem30 /usr/local/bin/gem
% ln -sf /usr/local/bin/bundle30 /usr/local/bin/bundle
% ln -sf /usr/local/bin/bundler30 /usr/local/bin/bundler
% ln -sf /usr/local/bin/typeprof30 /usr/local/bin/typeprof
% useradd -m -s /usr/local/bin/zsh dev
% passwd dev
% su dev
% cd
% echo "export CC=/usr/bin/clang" >> ~/.zprofile
% echo "export CXX=/usr/bin/clang++" >> ~/.zprofile
% bundle config set path /home/dev/.bundle/
% echo "path+=(/home/dev/.gem/ruby/3.0/bin)" >> ~/.zprofile
% echo "path+=(/home/dev/.local/share/gem/ruby/3.0/bin)" >> ~/.zprofile
% source ~/.zprofile
--
% gem install --user-install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /home/dev/.local/share/gem/ruby/3.0/gems/nokogiri-1.13.3/ext/nokogiri
/usr/local/bin/ruby30 -I /usr/local/lib/ruby/3.0 -r ./siteconf20220408-36538-4xc0ux.rb extconf.rb
checking for whether -I/usr/local/include is accepted as CPPFLAGS... yes
checking for whether -std=c99 is accepted as CFLAGS... no
checking for whether -Wno-declaration-after-statement is accepted as CFLAGS... no
checking for whether -g is accepted as CFLAGS... no
checking for whether -Winline is accepted as CFLAGS... no
checking for whether -Wmissing-noreturn is accepted as CFLAGS... no
Building nokogiri using packaged libraries.
Static linking is enabled.
Cross build is disabled.
Using mini_portile version 2.8.0
checking for iconv... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/$(RUBY_BASE_NAME)30
--help
--clean
--enable-system-libraries
--disable-system-libraries
--use-system-libraries
--prevent-strip
--enable-system-libraries
--disable-system-libraries
--use-system-libraries
--enable-system-libraries
--disable-system-libraries
--use-system-libraries
--enable-static
--disable-static
--enable-cross-build
--disable-cross-build
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-xml2-source-dir
extconf.rb:266:in `have_package_configuration': wrong number of arguments (given 1, expected 0; required keywords: lib, func, headers) (ArgumentError)
from extconf.rb:402:in `block in iconv_configure_flags'
from extconf.rb:294:in `preserving_globals'
from extconf.rb:402:in `iconv_configure_flags'
from extconf.rb:803:in `block in <main>'
from extconf.rb:438:in `block in process_recipe'
from <internal:kernel>:90:in `tap'
from extconf.rb:427:in `process_recipe'
from extconf.rb:781:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/dev/.local/share/gem/ruby/3.0/extensions/x86_64-openbsd/3.0/nokogiri-1.13.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/dev/.local/share/gem/ruby/3.0/gems/nokogiri-1.13.3 for inspection.
Results logged to /home/dev/.local/share/gem/ruby/3.0/extensions/x86_64-openbsd/3.0/nokogiri-1.13.3/gem_make.out
--
% pkg_info | grep iconv
libiconv-1.16p0 character set conversion library |
Can you tell me more about "OpenBSD 7.0 cloud instance"? Which cloud provider are you using, and did you select a specific flavor of the distro? I'd like to try to reproduce this. Regardless, though, the fix in #2505 will prevent the "wrong number of arguments" error. |
I'm using Vultr's Cloud Compute (Shared vCPU), no flavors just plain OpenBSD 7.0 x64.
Very cool 👍 |
By the way, I was wrong about this part:
It is unnecessary and will prevent
Without those exports, everything works just fine. |
Hello!
I'm using OpenBSD 7.0's official Ruby 3.0.3 package. I've replaced GCC with Clang in my environment, and restricted installs to user accounts for added security.
mkmf.log
Thanks!
The text was updated successfully, but these errors were encountered: