From: "drbrain (Eric Hodel)" Date: 2013-07-10T08:34:14+09:00 Subject: [ruby-core:55888] [ruby-trunk - Bug #8557][Closed] rubygems/security.rb is loaded twice if openssl is unavailable Issue #8557 has been updated by drbrain (Eric Hodel). Status changed from Assigned to Closed Fixed by r41873 ---------------------------------------- Bug #8557: rubygems/security.rb is loaded twice if openssl is unavailable https://bugs.ruby-lang.org/issues/8557#change-40389 Author: nobu (Nobuyoshi Nakada) Status: Closed Priority: Normal Assignee: drbrain (Eric Hodel) Category: lib/rubygems Target version: current: 2.1.0 ruby -v: 2.1.0dev Backport: 2.0.0: REQUIRED =begin Since r39606, ((%rubygems/security.rb%)) is loaded twice if ((%openssl%)) is unavailable. $ make TESTS=rubygems test-all CC = clang LD = ld LDSHARED = clang -dynamiclib CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-stateme XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin11 -I../src/include -I../src DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -install_name @executable_path/../lib/libruby.2.1.0.dylib -current_version 2.1.0 -compatibility_version 2.1.0 -fstack-protector -Wl,-u,_objc_msgSend -fstack SOLIBS = Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn) Target: x86_64-apple-darwin11.4.2 Thread model: posix ./miniruby -I../src/lib -I. -I.ext/common ../src/tool/runruby.rb --extout=.ext -- --disable-gems "../src/test/runner.rb" --ruby="./miniruby -I../src/lib -I. -I.ext/common ../src/tool/runruby.rb --extout=.ext -- --disable-gems" rubyge /Users/nobu/src/ruby/trunk/src/lib/rubygems/security.rb:355: warning: already initialized constant Gem::Security::DIGEST_ALGORITHM /Users/nobu/src/ruby/trunk/src/lib/rubygems/security.rb:355: warning: previous definition of DIGEST_ALGORITHM was here $ nmake TESTS=rubygems test-all CC = cl -nologo LD = cl -nologo LDSHARED = cl -nologo -LD CFLAGS = -MD -Zi -W2 -wd4996 -we4028 -we4142 -O2sy- -Zm600 XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/i386-mswin32_110 -I../src/include -I../src -I../src/missing CPPFLAGS = DLDFLAGS = -incremental:no -debug -opt:ref -opt:icf -dll SOLIBS = .\ruby.exe -I../src/lib -I".ext/i386-mswin32_110" -I. "../src/tool/runruby.rb" --extout=".ext" -- --disable-gems "../src/test/runner.rb" --ruby=".\ruby.exe -I../src/lib -I".ext/i386-mswin32_110" -I. "../src/tool/runruby.rb" --extout=".ext" -- --disable-gems" rubygems C:/Users/nobu/build/ruby/trunk/src/lib/rubygems/security.rb:355: warning: already initialized constant Gem::Security::DIGEST_ALGORITHM C:/Users/nobu/build/ruby/trunk/src/lib/rubygems/security.rb:355: warning: previous definition of DIGEST_ALGORITHM was here It seems to intend to fake (({OpenSSL})) but doesn't work actually, because (({Gem::Security::Policy})) requires ((%openssl%)). $ ./bin/ruby -rrubygems/security -ep C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- openssl (LoadError) from C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require' from C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/security/policy.rb:23:in `initialize' from C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/security/policies.rb:6:in `new' from C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/security/policies.rb:6:in `' from C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/security/policies.rb:1:in `' from C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require' from C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require' from C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/security.rb:583:in `' from C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require' from C:/Users/nobu/build/ruby/trunk/i386-mswin32_110/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require' bash: exit 1 $ ./bin/ruby -rrubygems/security -ep /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- openssl (LoadError) from /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require' from /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/security/policy.rb:23:in `initialize' from /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/security/policies.rb:6:in `new' from /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/security/policies.rb:6:in `' from /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/security/policies.rb:1:in `' from /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require' from /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require' from /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/security.rb:583:in `' from /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require' from /Users/nobu/build/ruby/trunk/x86_64-darwin/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:45:in `require' bash: exit 1 Moreover, since (({LoadError#path})) returns required library name with its suffix, so (({e.path == 'openssl'})) never become true. =end -- http://bugs.ruby-lang.org/