Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Ruby 1.9.3 p0 symbol visibility #56

Closed
wants to merge 1 commit into from

2 participants

@sj26

Removing visibility flag hiding required symbols in ruby binary.

Makes sure all libruby symbols are available from within the executable after final linking. Fixes ruby-debug19, passenger, and many other extensions.

@sj26 sj26 Removing visibility flag hiding required symbols in ruby binary.
Makes sure all libruby symbols are available from within the executable after
final linking. Fixes ruby-debug19, passenger, and many other extensions.
c55274a
@leehambley

+1 (Only because this issue doesn't seem to be getting much love)

@sj26

The correct solution for ruby-debug19 at least is to install the latest gems available from the rubyforge page:

http://rubyforge.org/frs/?group_id=8883

These haven't been pushed to rubygems.org so nobody thinks they exist.

@sj26 sj26 closed this
@leehambley

@sj26 What, exactly should be required to install these? I'm noticing / unsure about a couple of things.

  • When installing 1.9.3-p0 from source (autoconf -f && ./configure --prefix=/whatever && make && make install), or from rbenv. The following directory does not exist: $PREFIX/include/ruby-1.9.1/ruby-1.9.3-p0 - this appears to be required, as it contains a bunch of header files that appear to be important to compiling the native extensions. (What am I doing wrong?)

  • Is the symbol visibility patch still required? I noticed on the rubyforge thread that people were discussing that they were somehow private symbols, and Gems shouldn't be using them?

  • What role does the ruby-core-source gem play? Does that relate to my first point?

Thanks, sincerely - this is really stopping my team upgrading, so far we're using this home-grown build process which appears to work.

@leehambley

@sj26 I just noticed that you are Sam Cochran, and that it was your notes from the blog post dated 31.10.2011 that I've been referring to, including how to make sure the symbol exists.

The trick about making sure that $PREFIX/include/ruby-1.9.1/ruby-1.9.3-p0 exists (because it doesn't on many builds I have seen) came from somewhere else, but seemed to help. Especially in cases where the extracted tar-sources are not preserved (e.g. rbenv)

@leehambley

This works for me repeatably:

rbenv install 1.9.3-p0
rbenv rehash
cd ~
mkdir latest-debug-gems
cd latest-debug-gems
rbenv local 1.9.3-p0
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
wget http://rubyforge.org/frs/download.php/74596/ruby_core_source-0.1.5.gem
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
wget http://rubyforge.org/frs/download.php/63094/ruby-debug19-0.11.6.gem
gem install *.gem -- --with-ruby-include=$(echo ~/.rbenv/versions/1.9.3-p0/include/ruby-1.9.1/ruby-1.9.3-p0/) --no-rdoc --no-ri
cd -

rbenv install from ruby-build.

Verified working with:

$ ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
$ irb
irb(main):001:0> require 'ruby-debug'
=> true
irb(main):002:0> Debugger.start and puts Debugger.current_context
#<Debugger::Context:0x007f95c5a306a8>
=> nil

If you are using bundler, firstly I recommend 1.1 (install with --pre) as it's so much faster. But secondly bundler will detect the already installed Gems from above, and you won't have to care about bundle config or any build problems when installing your bundle.

You may want to cp the gems from above into your project's ./vendor/cache directory, so that Bundler doesn't fail to download them from rubygems.org.

My Gemfile entry for the above looks like:

group :development, :test do
  gem 'ruby_core_source', '0.1.5', :require => false
  gem 'linecache19', '0.5.13'
  gem 'ruby-debug-base19', '0.11.26'
  gem 'ruby-debug19', '0.11.6'
end
@leehambley

Additionally this only cures the ruby-debug problems, rack-perftools.rb et al still don't work.

I also had to upgrade rspec to 2.8.0, and remove --debug from my .rspec file. (With --debug, rspec tries to call require 'ruby-debug', which doesn't work, as its now require 'ruby-debug19' since ruby-debug-0.11.6 (maybe even sooner, but at least in 0.11.6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 31, 2011
  1. @sj26

    Removing visibility flag hiding required symbols in ruby binary.

    sj26 authored
    Makes sure all libruby symbols are available from within the executable after
    final linking. Fixes ruby-debug19, passenger, and many other extensions.
This page is out of date. Refresh to see the latest.
Showing with 0 additions and 1 deletion.
  1. +0 −1  configure.in
View
1  configure.in
@@ -493,7 +493,6 @@ if test "$GCC" = ""; then
AS_CASE(["$target_os"],[aix*],[warnflags="-qinfo=por"])
fi
if test "$GCC" = yes; then
- RUBY_TRY_CFLAGS(-fvisibility=hidden, [RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)])
AC_SUBST(WERRORFLAG, "-Werror")
if test "$visibility_option" = yes; then
RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)
Something went wrong with that request. Please try again.