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
Turn on --enable-shared
by default for all supported MRI Rubies
#1368
Conversation
Some gems need the host ruby to have shared library enabled. Currently, we're not aware of any potential downsides to having this enabled by default. > Shared libraries are libraries that are loaded by programs when they > start. When a shared library is installed properly, all programs that > start afterwards automatically use the new shared library. > [...] if you have a program that needs a shared library (in this case ruby > libruby.so.2.2.0 or similar) the program will fail if it doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no objection to this change. If we have some issues, we can revert this.
As mentioned in #35 (comment), one potential concern is that shared library might be a bit slower. I do remember observing that a long time ago on macOS. I'm measuring on Linux with OptCarrot, ran from the TruffleRuby repository to use a simple harness.
on top of
There is some noise, notably because I'm running this on my laptop, but it seems to indicate the difference, although it's not enough data to "prove" it. |
Here is a run with a bit less noise: |
@eregon Thank you for checking! Unless performance with |
@hsbt Let's leave this open for a day or two and merge if there is no evidence of significant regression. I thought that we might want to introduce a flag to disable shared, but we can also instruct people to copy the build definition to a separate file and remove |
@mislav I think it would be safer to introduce a flag or document a way to build without the shared library (maybe One more thing on this subject is RubyGems puts C extensions files for enable-shared Rubies in a different directory (which is good), see postmodern/chruby#410 (comment) |
@eregon Thank you for that bit of info! Merging this as-is. Let's see if it causes trouble. 🔥🔥 #famouslastwords |
ruby-build 20191030 * Turn on `--enable-shared` by default for all supported MRI Rubies. rbenv/ruby-build#1368 Some gems need the host ruby to have shared library enabled. Currently, we're not aware of any potential downsides to having this enabled by default. * tag 'ruby-build/v20191030': ruby-build 20191030 Turn on `--enable-shared` by default for all supported MRI Rubies Correct a typo in ruby-build
as an workaround for Ruby bug 16331: https://bugs.ruby-lang.org/issues/16331 Due to this bug, build will fail with FreeBSD's make after rbenv#1368. The bug is already fixed in MRI upstream but GNU make is still required when building older releases of Ruby. Use GNU make rather than switching make/gmake depending of Ruby version. See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241633
Agreed. We recently disabled that flag and got a Could this PR be reconsidered? Or at least could we make it easier to opt out? Because right now passing |
I think we should avoid changing the default back, as that would be an incompatible change for users relying on having the shared library (some gems need it).
That would be good. Could you make a PR to add that? |
Agreed.
I'll look into it. |
Some gems need the host ruby to have shared library enabled. Currently, we're not aware of any potential downsides to having this enabled by default.
Fixes #35, ref. #921
Should we support a flag to disable shared, i.e. to override the default?