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

Support is broken for Ruby 1.9.2 #1207

Closed
mdchaney opened this issue Dec 11, 2014 · 10 comments
Closed

Support is broken for Ruby 1.9.2 #1207

mdchaney opened this issue Dec 11, 2014 · 10 comments

Comments

@mdchaney
Copy link

The issue is on line 77 of extconf.rb:

https://github.com/sparklemotion/nokogiri/blob/master/ext/nokogiri/extconf.rb#L77

if try_compile("int main() {return 0;}", '', werror: true)

"try_compile" takes two arguments and a block:

def try_compile(src, opt="", &b)
  try_do(src, cc_command(opt), &b)
ensure
  rm_f "conftest*"
end

This seems consistent throughout Ruby 1.9.2. In 1.9.3 there's a change:

def try_compile(src, opt="", *opts, &b)
  with_werror(opt, *opts) {|_opt, *_opts| try_do(src, cc_command(_opt), *_opts, &b)}
ensure
  rm_f "conftest*"
end

Removing the last argument lets compilation proceed in 1.9.2.

@nirvdrum
Copy link

This broke starting in nokogiri 1.6.4.1. 1.6.4 installs just fine. I don't think the Ubuntu version matters much. I'm seeing the same issue with 14.04.1.

@knu
Copy link
Member

knu commented Dec 20, 2014

I wasn't even aware nokogiri should support ruby 1.9.2 because our README.rdoc states it requires 1.9.3 or higher. 1.9.2 had been reached its end of life as of about half a year ago, so I think we should fix the gemspec instead...

@knu
Copy link
Member

knu commented Dec 20, 2014

Or, someone could make a monkey-patch for try_compile() of 1.9.2 and we'd be happy to merge it.

@nirvdrum
Copy link

I wasn't aware 1.9.2 wasn't supported. Thanks for the info. For me, the failure started when a gem I maintain that does support 1.9.2 got a newer version of nokogiri on Travis. Dropping 1.9.2 is probably fine, but I think doing it in a point release is a bit harsh. This broke in a patch release.

I'll look into the monkey-patching.

@mdchaney
Copy link
Author

gemspec needs to be updated, then, as that's what I was looking at to determine lowest Ruby version. I agree there's no pressing reason to support an abandoned Ruby version but the gemspec should contain proper information.

knu added a commit that referenced this issue Dec 26, 2014
Ruby 1.9.2 has reached its end-of-life as of several months ago, and
Nokogiri 1.6.5 unfortunately does not build with it.
@knu
Copy link
Member

knu commented Dec 26, 2014

This was really an unfortunate situation. Actually the code I put in 1.6.4 already assumed the minimum requirement of ruby >=1.9.3, which unfortunately had a bug which was then fixed in 1.6.4.1. I dropped 1.9.2 from our Travis-CI configuration around mid-2013, so we don't even know if nokogiri has been working fine with ruby 1.9.2 since then.

I've just raised the minimum requirement for ruby to 1.9.3 for consistency, but I fully understand it may be harsh to drop support in a patch release. So, please feel free to submit a monkey patch and I'll put it in recovering the required_ruby_version for the next patch release. Thank you!

@flavorjones flavorjones changed the title Doesn't build on Ubuntu 10.04.4 with Ruby 1.9.2-p290 [zlib detection] Doesn't build on Ubuntu 10.04.4 with Ruby 1.9.2-p290 Dec 29, 2014
@flavorjones flavorjones changed the title [zlib detection] Doesn't build on Ubuntu 10.04.4 with Ruby 1.9.2-p290 Doesn't build on Ubuntu 10.04.4 with Ruby 1.9.2-p290 Dec 29, 2014
@flavorjones flavorjones changed the title Doesn't build on Ubuntu 10.04.4 with Ruby 1.9.2-p290 Support is broken for Ruby 1.9.2 Dec 29, 2014
@flavorjones flavorjones mentioned this issue Jan 19, 2015
6 tasks
@flavorjones
Copy link
Member

The breaking commit is 2054448.

@nirvdrum
Copy link

Thanks for calling that out. I saw GitHub linked to my comment, but it's been drowned out. Unfortunately, I've just started a new job and haven't managed to scrounge together the time to fix this.

@flavorjones
Copy link
Member

This will be fixed in v1.6.6.

Note, however, I've officially proposed ending support for Ruby 1.9.2 as of Nokogiri 1.7.0 in #1227.

@mdchaney
Copy link
Author

Thanks to all for the good work on this.

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

No branches or pull requests

4 participants