-
-
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
extconf not adding an appropriate -I for gumbo-parser on macOS #2689
Comments
@stevecheckoway Likely that compiler flag is coming from Ruby itself. Can you take a look at the value of If so, one possible cause is that you've upgraded clang or xcode or whatever since that Ruby executable was built, and so your current compiler doesn't understand flags that were used to compile Ruby with your previous compiler. |
Good thinking! I suspect that what happened is my Ruby was compiled by a newer compiler (via Nix) than what I have installed on that machine. (That particular machine is stuck on the last version of macOS that supports 32-bit binaries.) I'll head into the office (where that machine is located currently) and check. |
Regardless, it would be good to add that clang flag on darwin. Can you kick the tires on #2690? |
#2690 fixes the problem. You were correct about the cause: irb(main):002:0> RbConfig::CONFIG["CFLAGS"].split
=>
["-fdeclspec",
"-O3",
"-fno-fast-math",
"-ggdb3",
"-Wall",
"-Wextra",
"-Wdeprecated-declarations",
"-Wdivision-by-zero",
"-Wimplicit-function-declaration",
"-Wimplicit-int",
"-Wmisleading-indentation", # <---
"-Wpointer-arith",
"-Wshorten-64-to-32",
"-Wwrite-strings",
"-Wold-style-definition",
"-Wmissing-noreturn",
"-Wno-constant-logical-operand",
"-Wno-long-long",
"-Wno-missing-field-initializers",
"-Wno-overlength-strings",
"-Wno-parentheses-equality",
"-Wno-self-assign",
"-Wno-tautological-compare",
"-Wno-unused-parameter",
"-Wno-unused-value",
"-Wunused-variable",
"-Wextra-tokens",
"-Wundef",
"-fno-common",
"-pipe"] |
👍 when that PR goes green I'll merge it. In the meantime you should be able to work around this by setting your environment variable append_cflags(ENV["CFLAGS"].split) unless ENV["CFLAGS"].nil? |
Please describe the bug
When compiling the C extension on macOS, compiling
gumbo.c
fails because it cannot findnokogiri_gumbo.h
. The real problem is that the-Ipath/to/gumbo-parser/include
is not getting passed to the compiler.Here's the relevant line in the
mkmf.log
fileThe underlying problem seems to be that the configuration test is using
-Werror
along with the unsupported warning-Wmisleading-indentation
.Here's the relevant portion of the log. Note that checking for the flag fails but that the last line shows checking for
gumbo_parse_with_options()
succeeds.One work-around is to add
to
extconf.rb
. But maybe a better option would be to figure out where-Wmisleading-indentation
(or-Werror
) is coming from and fix that.The text was updated successfully, but these errors were encountered: