seattlerb/ruby2ruby

ruby2ruby and ruby_parser define Regexp constants with different checks

zeha opened this issue · 3 comments

zeha commented

Ruby Version: ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

Warnings:
ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10: warning: already initialized constant ENC_NONE
ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11: warning: already initialized constant ENC_EUC
ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12: warning: already initialized constant ENC_SJIS
ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13: warning: already initialized constant ENC_UTF8

This /probably/ happens when ruby_parser gets loaded before ruby2ruby is loaded.

This is a strange one - the error doesn't seem to break anything, but it seems to block for 3-4 seconds when I require the library?

I see no reason why there should be a 3-4 second delay on anything. I'd need a separate ticket filed on that with a repro.

This issue should be fixed already.

zeha commented

This is not fixed with the current versions of ruby2ruby and ruby_parser:

% gem list ruby2ruby

*** LOCAL GEMS ***

ruby2ruby (1.3.1)

% gem list ruby_parser

*** LOCAL GEMS ***

ruby_parser (2.3.1)

% cat repro.rb 
require "rubygems"
require "ruby2ruby"
require "ruby_parser"

% ruby ./repro.rb               
/var/lib/gems/1.9.1/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10: warning: already initialized constant ENC_NONE
/var/lib/gems/1.9.1/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11: warning: already initialized constant ENC_EUC
/var/lib/gems/1.9.1/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12: warning: already initialized constant ENC_SJIS
/var/lib/gems/1.9.1/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13: warning: already initialized constant ENC_UTF8