oracle / truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM.
https://www.graalvm.org/ruby/
Other
3.02k stars 185 forks source link

Update RubyGems fails #1479

Closed guizmaii closed 2 years ago

guizmaii commented 5 years ago

Hi,

I was trying Truffle v1.0.0-RC9 and just after installing it, I tried to update RubyGems, which failed:

➜  gem update --system
Updating rubygems-update
Fetching: rubygems-update-2.7.8.gem (100%)
Successfully installed rubygems-update-2.7.8
Parsing documentation for rubygems-update-2.7.8
Installing ri documentation for rubygems-update-2.7.8
Installing darkfish documentation for rubygems-update-2.7.8
ERROR:  While executing gem ... (RDoc::Error)
    error generating index.html: unexpected return (LocalJumpError)

It was very long and finally failed.

Here's my Graal version:

➜  ~ java -version
openjdk version "1.8.0_192"
OpenJDK Runtime Environment (build 1.8.0_192-20181024123616.buildslave.jdk8u-src-tar--b12)
GraalVM 1.0.0-rc9 (build 25.192-b12-jvmci-0.49, mixed mode)

here's my Ruby version:

➜  ruby -v
truffleruby 1.0.0-rc9, like ruby 2.4.4, GraalVM CE Native [x86_64-darwin]
chrisseaton commented 5 years ago

There's not much backtrace there! I can't find a --trace option or similar in the gem command, so could you possibly run with -Xbacktraces.raise to achieve the same thing, and post the results, please?

guizmaii commented 5 years ago

Yes, of course.

How can I pass this option ? because adding it to the command line doesn't work:

➜  gem update --system -Xbacktraces.raise
ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: -Xbacktraces.raise
chrisseaton commented 5 years ago

Ah sorry, use TRUFFLERUBYOPT=-Xbacktraces.raise gem update ....

https://github.com/oracle/truffleruby/blob/vm-1.0.0-rc9/doc/user/options.md

guizmaii commented 5 years ago

I did that:

➜  gem update --system -- -Xbacktraces.raise         
Updating rubygems-update
Successfully installed rubygems-update-2.7.8
Parsing documentation for rubygems-update-2.7.8
Done installing documentation for rubygems-update after 3 seconds
Parsing documentation for rubygems-update-2.7.8
Done installing documentation for rubygems-update after 1 seconds
Installing RubyGems 2.7.8
Bundler 1.16.6 installed
RubyGems 2.7.8 installed
Regenerating binstubs
Parsing documentation for rubygems-2.7.8
Installing ri documentation for rubygems-2.7.8

=== 2.7.8 / 2018-11-02

Minor enhancements:

...

------------------------------------------------------------------------------

RubyGems installed the following executables:
        /Users/jules/tools/graalvm-ce-1.0.0-rc9/Contents/Home/jre/languages/ruby/bin/trufflegem
        /Users/jules/tools/graalvm-ce-1.0.0-rc9/Contents/Home/jre/languages/ruby/bin/trufflebundle

Ruby Interactive (ri) documentation was installed. ri is kind of like man 
pages for Ruby libraries. You may access it like this:
  ri Classname
  ri Classname.class_method
  ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.

RubyGems system software updated
➜ ruby -v
truffleruby 1.0.0-rc9, like ruby 2.4.4, GraalVM CE Native [x86_64-darwin]
➜  gem -v
2.7.8

and this time, it worked...

I'll re-try tomorrow to make it fail with the -Xbacktraces.raise. It's a bit late here.

eregon commented 2 years ago

Very likely related to #2438. A workaround is having a ~/.gemrc with gem: --no-document. This is also the default, so now it just works and this is solved: https://github.com/oracle/truffleruby/blob/8839057f6c9b8b9e72ddb3650085a711a2505256/lib/truffle/rubygems/defaults/truffleruby.rb#L25-L30