-
Notifications
You must be signed in to change notification settings - Fork 63
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
Exception when requiring after 'mkmf' library #47
Comments
requiring mkmf can interfere with other gems, such as scrypt. see pbhogan/scrypt#47
Hmm, so it seems to me the "right" thing to here is to fix |
Thanks for doing the detective work on this, btw, @febeling ! |
Yes, the right fix would be to isolate mkmf cleanly into a module. But FFI is also a bit casual about grabbing any For the first fix, a major version bump would be exactly the right tool. Too bad this is a core module, and not a gem. But there must be an equivalent to a major version bump in core? What is generally done to break an API in such cases in ruby? I don't know if it's a bad idea, but maybe define the whole module just without the |
Yes, that was exactly my thought... extracting Looking into more short-term workarounds, I found the https://github.com/rosylilly/uninclude gem, which, in theory, would let one immediately uninclude |
Top-level namespace stuff is weird. This works: require 'uninclude'
require 'mkmf'
Object.send :uninclude, MakeMakefile After which you can call methods directly on |
Yes, it looks like a welcome workaround for anyone who's blocked by this problem. It also neatly fits the description you gave a few days back - good job :) Not sure if you agree, maybe this issue could even be closed now? One can argue that the main issue is poor practice in |
I think we should leave the issue open until the workaround is no longer needed with the latest gems versions |
Steps to reproduce:
Also reproducible on ruby-2.2.0. Haven't tried others.
The text was updated successfully, but these errors were encountered: