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
FFI::Struct#layout fails when mkmf is required #776
Comments
I filed an issue for mkmf too since it doesn't seem reasonable to have so many public methods: But we'll need a workaround in FFI, as old releases won't be fixed. |
I think the actual intention was to restrict to FFI::Library or FFI::Struct, so the condition should be: if mod.respond_to?(:find_type) && (mod.is_a?(FFI::Library) || mod < FFI::Struct)
mod
end This works and passes all specs. Another possibility is to check arity, but that's less reliable and not pretty: https://gist.github.com/eregon/61ff7e20aaaa5af35a3e6401603d1f7f |
PR to fix this: #777 |
The intention behind |
This is due to
ffi/lib/ffi/struct.rb
Line 247 in 33fb45a
and
mkmf
defining a publicfind_type
on every object byinclude MakeMakefile
😞On TruffleRuby, the socket stdlib uses FFI, so this bug ends up failing to install some gems that require
socket
(indirectly) inextconf.rb
, see oracle/truffleruby#1896The text was updated successfully, but these errors were encountered: