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] bundle update pulls in racc with native extensions #2166
Comments
Seeing a similar issue in Chef / Windows, causes gcc dependency failure. |
Hi, @wlipa! Thanks for reporting this, and sorry you're having issues. It sounds like you're describing
@k-brooks without more information from you, I'm afraid I can't help you. "gcc dependency failure" does not sound like what @wlipa is describing; if you're seeing something different and not addressed by my comment above can you please open a new issue? |
It's not exactly an issue for me. It's just a little ironic that nokogiri apparently goes through a bit of trouble to avoid having native gem install issues for its direct native needs, but adds a dependency on racc for theoretical future-proofing which adds another native gem extension. I just question whether the explicit racc dependency is actually a good idea if bundler users are going to have to compile a native racc extension by default, rather than relying on the one pre-packaged with ruby. |
By default Bundler always installs the most recent version of package no matter what you have on system. But that is Bundler choice. If Bundler used the installed package, the would be no issues. |
The pessimistic dependency on racc 1.4 from nokogiri introduces a (system) dependency on gcc to compile it. |
That's true. The Nokogiri maintainers should make a choice about a racc dependency based on the overall tradeoff between the impact on the developer ecosystem as it exists (including Bundler behavior) vs. future-proofing concerns. |
Disregard, misread |
Presumably the version of racc that's needed for the workaround is tied to the version of Ruby you have installed. It's certainly the case that this change makes it harder to install nokogiri for users today. |
I'm not a direct user of either racc or nokogiri - I am using it due to the Rails dependency. So in order to avoid installing an additional native extension, I have to add an extra line to my Gemfile with the precise version of a doubly indirect dependency that varies based on the version of Ruby that's in use. I can certainly do that after having researched and understood the issue. All rails/bundler users would presumably need to go through the same process if they want to avoid the additional native code dependency. They would also need to update that line when switching ruby versions. I thought one of the highlights of this release was to reduce the pain of installing native extensions for nokogiri. That seems to have been achieved for nokogiri itself, but adding an additional native gem dependency is somewhat of a step backwards, even if there is a fairly straightforward (if obscure) workaround. From the discussion in #1988, it seems like the benefits of declaring this dependency are rather abstract. I'm questioning if it's worth causing users to either have to know about this and do some maintenance to avoid it, or to have the extra native compilation step and potential install issues from that. |
It seems to me you are trying to solve the wrong problem. The only issue is that you are using mix of prebuilt binary packages and packages you have to build by yourselves. Therefore I'd like to suggest you to try to request Racc upstream to provide binary gem the same way Nokogiri does that. Just for the record, arguing against properly specifying dependencies is wrong. Just take look on Ruby 3.0. Whoever previously thought it is fine to depend on WEBrick, because it is part of the StdLib will have a problem now. Similarly, if somebody ever used ReXML, they have to change their Gemfiles now. |
@wlipa I understand what you're saying, but what I'm saying is that we have made that decision weighing tradeoffs, and we're moving ahead with this dependency being properly declared in the gemspec.
I'm not sure I understand how. Users upgrading from Nokgiri v1.10.x already have the toolchain in place to compile C extensions, and so my mental model is that this is not blocking anyone from upgrading right now. Please help me understand if upgrading is blocked for some users, and if so how. |
Fair enough. I just wanted to make it clear that the typical Rails use case will now have an additional native gem installation requirement via Nokogiri, in case that was not realized. Installing an additional gem with native extensions can only be more difficult than not installing it at all, which was the case until the dependency was added. |
Thanks again for opening this issue and talking to us about the situation. |
Not to beat a dead horse, but sadly I just got this in an email from a colleague asking for installation help.
|
I've added documentation about racc here: https://nokogiri.org/tutorials/installing_nokogiri.html#cannot-install-racc |
I also had a colleague ask me about problems compiling |
(I still haven't figured out what the actual compilation error is, unfortunately, but this was an unfortunate blocker for us upgrading. Will follow up once I have more details) |
@nightpool I linked to this in an earlier comment: https://nokogiri.org/tutorials/installing_nokogiri.html#cannot-install-racc If you're experiencing some other error, can you please provide specifics in a new issue created at https://github.com/ruby/racc ? |
Doing a standard bundle update with a rails app that indirectly pulls in nokogiri has a new native gem dependency on racc with nokogiri 1.11.0. That is despite the fact that racc is a default gem in ruby 2.7 (albeit at an older version).
Before:
After:
Have you read and followed the installation tutorial at http://www.nokogiri.org/tutorials/installing_nokogiri.html?
What is the complete output of
gem install
orbundle install
?Tell us about your system!
What is the output from
ruby -v
?ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin20]
What is the output from
gem -v
?3.1.4
What is the output from
gem env
?If you're using Bundler:
bundle version
?Bundler version 2.1.4 (2021-01-04 commit unknown)
bundle config
? (Take care to redact any credentials)If you're on MacOS, please note:
12.3
gcc -v
orclang -v
The text was updated successfully, but these errors were encountered: