Issue #11940 has been updated by Hiroshi SHIBATA.

Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: REQUIRED

----------------------------------------
Bug #11940: Ruby fails to compile with --with-static-linked-ext
https://bugs.ruby-lang.org/issues/11940#change-56273

* Author: Luiz Angelo Daros de Luca
* Status: Third Party's Issue
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: REQUIRED
----------------------------------------
Hello,

When I select to include all ext static linked and between them there is openssl, ruby fails to build.

~~~

$ ./configure --disable-install-doc     --disable-install-rdoc     --disable-install-capi   --with-static-linked-ext
$ make
$ make install
(...)
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./x86_64-linux-fake ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc"
/tmp/ruby-2.3.0/lib/rubygems/security.rb:344:in `<module:Security>': uninitialized constant OpenSSL::Digest::SHA1 (NameError)
	from /tmp/ruby-2.3.0/lib/rubygems/security.rb:332:in `<top (required)>'
	from /tmp/ruby-2.3.0/lib/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /tmp/ruby-2.3.0/lib/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /tmp/ruby-2.3.0/lib/rubygems/package.rb:44:in `<top (required)>'
	from /tmp/ruby-2.3.0/lib/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /tmp/ruby-2.3.0/lib/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /tmp/ruby-2.3.0/lib/rubygems/installer.rb:10:in `<top (required)>'
	from /tmp/ruby-2.3.0/lib/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /tmp/ruby-2.3.0/lib/rubygems/core_ext/kernel_require.rb:55:in `require'
	from ./tool/rbinstall.rb:657:in `<module:RbInstall>'
	from ./tool/rbinstall.rb:585:in `<main>'
uncommon.mk:267: recipe for target 'do-install-nodoc' failed
make: *** [do-install-nodoc] Error 1

~~~



It seems that `OpenSSL::Digest` is defined by the builtin ext (in miniruby?!), which breaks the logic at:

~~~ruby

  DIGEST_ALGORITHM =
    if defined?(OpenSSL::Digest) then
      OpenSSL::Digest::SHA1
    end

~~~

`OpenSSL::Digest` is defined (because it has methods like `digest` and `hexdigest`) but not `OpenSSL::Digest::SHA1`.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>