-
-
Notifications
You must be signed in to change notification settings - Fork 897
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
Different compiler needed on OpenBSD #1515
Comments
I'm not sure I understand why this would be happening. If you take a look at Can you explain a bit about why "you need to install a newer compiler to get Nokogiri 1.6.8. to compile"? I'd like to understand a bit better the problem you're trying to solve. |
We install ruby from packages, and it was compiled using gcc 4.2 which is the default compile (i.e. |
Hi, i unfortunately still don't understand the problem you're trying to solve. Can you show me what happens when you compile using the default settings? What breaks? Can you show the logs? |
The problem is simple: default gcc in OpenBSD is too old to compile libxml2. It gives this error during install of nokogiri:
with CC=egcc it works fine. I want to fix this in the gem by detecting OpenBSD and using the newer compiler. |
This seems like something that needs to be fixed in the documentation as well; introducing it into the build without noting that If you'd like to send a PR to both the installation tutorial and the Nokogiri build script, those would be welcomed. |
So the answers to my original two questions: "Would you be willing to add such an exception/workaround? If so, what would be the best place to put this?" are: Yes and in the build script? Where can I find that script? I'm willing to create PR's for it yes :) |
The answers to your two questions are:
The build script in this case is |
If you install both libxml and nokogiri using OpenBSD packages, things work fine with the OpenBSD system compiler (gcc 4.2.1), even though OpenBSD's libxml port is for version 2.9.4. I'm working on update for the OpenBSD nokogiri port (from 1.6.6.2 -> 1.7.0.1) and noticed that nokogiri was now forcing egcc use even though it is not necessary or desirable. Installing nokogiri with In the future, if you have questions about nokogiri usage on OpenBSD, you may want to ask the maintainer of the nokogiri port for OpenBSD (me). |
@frenkel care to comment on the above? |
@jeremyevans I had no idea there even was a port for OpenBSD, so please don't be offended by the fact that nobody asked. I'm happy to have you coordinate a fix for this. Do you have thoughts on what the right thing to do here is? @knu, would you mind working with Jeremy on addressing any changes he feels need to be made? |
@flavorjones It seems right to only do this when not using system libraries. That way it will work in both cases on OpenBSD and won't unnecessarily require egcc. |
I've submitted a pull request that I think will fix the issue. @flavorjones I apologize, I was in a bit of a hurry when I wrote my previous post, and I think I came off a bit harsh, which wasn't my intent. I definitely appreciate the work you are doing to maintain nokogiri. If you have questions about nokogiri usage on OpenBSD in the future, please do reach out to me and I'll do what I can to help. |
Only require ports GCC on OpenBSD if not using system libraries (Fixes #1515)
@flavorjones Sure, and I've merged the PR above. The term "port" in OpenBSD (and FreeBSD) refers to a recipe to build a package from source, and it looks like OpenBSD currently has no local patch in its port, which we, the developers and contributors, can all be proud of. |
@jeremyevans Thanks for the PR. I see you are listed as maintainer of the OpenBSD port, and I much appreciate what you have been doing for it and many other ports related to the ecosystem around Nokogiri! We'll do our best to reach out to you in the future whenever we know a change may affect OpenBSD, however we deal with a lot of platforms and sometimes we may make a mistake and accidentally break the build on a specific platform while trying to fix an issue for other platforms. So, as much as we take care, please watch this project and let us know if you find we are doing wrong for OpenBSD. We'll always be open to improvements. Thanks! |
@knu Good to hear such a positive attitude towards non-Linux systems. Keep up the good work! |
On OpenBSD you need to install a newer compiler to get Nokogiri 1.6.8 to compile. This newer compiler is called
egcc
(for external I think). It would be great if Nokogiri's install process could detect it, so a normalbundle install
would run without problems. Currently we need to manually connect to the server and runCC=egcc bundle install
. Would you be willing to add such an exception/workaround? If so, what would be the best place to put this? I can then make a pull request for it.Thanks and keep up the good work!
The text was updated successfully, but these errors were encountered: