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] 1.12.2: gumbo.c compilation failure on el6, el7, sles12 #2302
Comments
@jkschulz Thank you for submitting this report! I will take a look as soon as I can. In the meantime, you may want to work around this by installing v1.11.x which doesn't package libgumbo. |
Looks like we just need to be passing |
@stevecheckoway Right, but we are doing that! https://github.com/sparklemotion/nokogiri/blob/main/gumbo-parser/src/Makefile#L5 So we need to reproduce this and figure out why it's not in effect. I should have time in the next day or so, but if you get to it first 👍 |
Ah yes, so we are. I wonder if something is overriding the CFLAGS on centos or possibly filtering it. I'm unlikely to have time in the next few days, unfortunately. |
thanks @flavorjones and @stevecheckoway! |
@jkschulz OK, I've reproduced this and have a workaround for you. Diagnosis The failure is coming from compiling Workaround # 1 You can use the precompiled native gem instead of compiling during installation, as the Workaround # 2 Or, if you need to compile at installation time, you can set a
Next steps I want to add test coverage for RHEL/Centos and then fix this permanently. Will work on a PR in the next day or two. |
#2303 will fix this. It's going through CI now, and assuming it goes green I'll be able to cut a patch release tomorrow. |
c99 fixes --- **What problem is this PR intended to solve?** #2302 reports a compilation failure on RHEL6, RHEL7, and SLES12. These are older distros (RHEL7 is running gcc 4.8) which seem to compile in a C90-ish mode by default that gives errors on C99-isms. This PR removed the C99isms (which are errors) as well as some C90isms (which generate warnings). Specifically: - don't declare a variable in a `for` statement (C99-ism) - don't mix declarations and code (C90-ism) This PR also cleans up some C casting related to how we're handling `const` qualifiers. Specifically: - `gumbo.c` is now using `(const xmlChar *)` in place of `BAD_CAST` (which is an alias for `(xmlChar *)`) - extracted the const-discard hack `(xmlChar *)(uintptr_t)ptr` into a macro `DISCARD_CONST_QUAL` - introduce use of `DISCARD_CONST_QUAL` in one additional place in `xml_node.c` As a result, even when using `-Wcast-qual` on older Rubies that support it, we now see no compiler warnings. **Have you included adequate test coverage?** I considered setting up CI using a comparable Centos docker image, but I didn't feel like there was much regression value to that test, given the nature of this failure. I could be argued into doing it, if anyone feels strongly.
wow, thanks for handling this so quickly! until the new release is out, we've pinned to 1.11.7 (as suggested) and it does indeed work 🙌 |
Installation fails on CentOS 6, CentOS 7, and SLES 12 for v1.12.0+ with libgumbo errors. Works fine on CentOS 8 and SLES 15.
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
?If installation failed during compilation, what are the complete contents of the
mkmf.log
file generated during the failed installation?Tell us about your system!
What is the output from
ruby -v
?ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
What is the output from
gem -v
?3.0.8
What is the output from
gem env
?If Linux or a BSD variant, please note:
CentOS 7
(CentOS Linux release 7.9.2009 (Core)
)uname -a
:Linux 27329c33e888 5.10.40-1rodete2-amd64 #1 SMP Debian 5.10.40-1rodete2 (2021-06-22) x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: