Eliminate all magic builtin libraries #5591
This is for Shopify/bootsnap#162, and should allow all our "built in" libraries to have their require paths cached like any other library. This eliminates the need for Shopify/bootsnap#200. Other changes that come along with this: * Remainder of Continuation logic moved to the .rb library and removed from native. * net/protocol native library removed. * NKFLibrary removed since it only loaded NKF class. * digest/digest/bubblebabble.rb removed since it does not exist in MRI (it's just digest/bubblebabble.rb). * Methods for builting libs are now deprecated and do nothing. This include the "internal_libraries" method added for Shopify/bootsnap#200. * Replaces "etc.so" with "etc" in standard libraries, since the .so version will only search for exts (which will be .jar files in JRuby)
@kares Yeah the new mechanism is what I had in mind. I think almost all the changes I made should work ok with that. Java, JRuby, and JRubyUtil libraries will continue to be initialized from Ruby.java since they need to be there for other pieces, but the remaining libraries should be able to use your ext method. Sound ok?
I don't think there's any reason this has to be in 9.2.6 if we've got a 9.2.7 coming before end of month. Clock's ticking on getting a stable release for Rails 6.
JRuby::Util actually didn't change much at all. The only thing that is now deprecated is the listing of internal libraries that bootsnap was going to use to work around our buitins. They could still release that patch (Shopify/bootsnap#162) or we could just say JRuby 9.2.x is needed for bootsnap to work.
@kares Need you to review ae9d88d for sure; I made this change just to get better logging of the exception that was breaking various ext loads, but once I made it the breaking loads started to work again. I suspect something about your re-raising as NameError was screwing up some extension load/fallback logic.
This reverts commit fba37c6.
Specifically, I know that the current racc "cparse" ext release uses RubyContinuation directly. This has been patched on racc master, but there has been no release for quite some time. See ruby/racc#91.
I have tested with bootsnap in Rails 5.2.0, and all seems to be working properly. I added some logging to prove that bootsnap is properly caching paths to all required libraries:
I also see our former built-in libraries in this list, like