Project

General

Profile

Feature #13302

Provide a (force) --enable-openssl switch for ruby ./configure (or similar)

Added by shevegen (Robert A. Heiler) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:80033]

Description

I am currently setting up a lot of programs on a fresh installation.

Ruby compiles fine but I am having some problem getting openssl to
work properly. Since it is not trivial for me to find out where
the problem is exactly, I would like to suggest a commandline
switch option such as --enable-openssl that will only compile
ruby if it can also use the openssl bindings.

The ruby that is compiled without openssl is for me not very
useful, largely because I can not use gem publish without
openssl.

If such an option would exist, it is my hope that I could use
it, and then ruby would also tell me why it can not use
openssl.

For the record, I was using the LFS way to install openssl:

http://www.linuxfromscratch.org/blfs/view/svn/postlfs/openssl.html

Openssl also compiled fine. I suspect that ruby may get
confused by some files by the host pclinuxos system but
until I have found out where the problem is, I think it
would be nice i ruby would have a corresponding switch
to only compile if openssl can also be used, as otherwise
this ruby variant is not very useful to me and I will waste
time compiling something that I know won't be too useful.

Sometimes going into ext/ can help here but ext/openssl
is also not useful for me right now.

Associated revisions

Revision 826f16d4
Added by rhe over 2 years ago

extmk.rb: improve message printed when configuring extensions fails

Point to the mkmf.log if configuring an extension fails so that people
can find and fix the culprit easily. [ruby-core:80131] [Feature #13302]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58404
Added by rhenium (Kazuki Yamaguchi) over 2 years ago

extmk.rb: improve message printed when configuring extensions fails

Point to the mkmf.log if configuring an extension fails so that people
can find and fix the culprit easily. [ruby-core:80131] [Feature #13302]

Revision 58404
Added by rhe over 2 years ago

extmk.rb: improve message printed when configuring extensions fails

Point to the mkmf.log if configuring an extension fails so that people
can find and fix the culprit easily. [ruby-core:80131] [Feature #13302]

Revision 58404
Added by rhe over 2 years ago

extmk.rb: improve message printed when configuring extensions fails

Point to the mkmf.log if configuring an extension fails so that people
can find and fix the culprit easily. [ruby-core:80131] [Feature #13302]

Revision b58a30e1
Added by nobu (Nobuyoshi Nakada) over 2 years ago

extmk.rb: fail for mandatory libraries

  • ext/extmk.rb: fail if a mandatory extension library failed to
    configure. [ruby-core:80759] [Feature #13302]

  • template/exts.mk.tmpl: move exit at the end.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58412
Added by nobu (Nobuyoshi Nakada) over 2 years ago

extmk.rb: fail for mandatory libraries

  • ext/extmk.rb: fail if a mandatory extension library failed to
    configure. [ruby-core:80759] [Feature #13302]

  • template/exts.mk.tmpl: move exit at the end.

Revision 58412
Added by nobu (Nobuyoshi Nakada) over 2 years ago

extmk.rb: fail for mandatory libraries

  • ext/extmk.rb: fail if a mandatory extension library failed to
    configure. [ruby-core:80759] [Feature #13302]

  • template/exts.mk.tmpl: move exit at the end.

Revision 58412
Added by nobu (Nobuyoshi Nakada) over 2 years ago

extmk.rb: fail for mandatory libraries

  • ext/extmk.rb: fail if a mandatory extension library failed to
    configure. [ruby-core:80759] [Feature #13302]

  • template/exts.mk.tmpl: move exit at the end.

Revision 23e481e3
Added by nobu (Nobuyoshi Nakada) over 2 years ago

common.mk: separate note

  • common.mk (build-ext): separate note from building extensions, not to be intermingled. [ruby-core:80759] [Feature #13302]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58414
Added by nobu (Nobuyoshi Nakada) over 2 years ago

common.mk: separate note

  • common.mk (build-ext): separate note from building extensions, not to be intermingled. [ruby-core:80759] [Feature #13302]

Revision 58414
Added by nobu (Nobuyoshi Nakada) over 2 years ago

common.mk: separate note

  • common.mk (build-ext): separate note from building extensions, not to be intermingled. [ruby-core:80759] [Feature #13302]

Revision 58414
Added by nobu (Nobuyoshi Nakada) over 2 years ago

common.mk: separate note

  • common.mk (build-ext): separate note from building extensions, not to be intermingled. [ruby-core:80759] [Feature #13302]

Revision 3ca61bb0
Added by nobu (Nobuyoshi Nakada) over 2 years ago

exts.mk: refine notes [Feature #13302]

  • ext/extmk.rb: split notes into header and footer, which are
    common, from bodies which are unique for each extensions.

  • template/exts.mk.tmpl: now each notes are not one line, should
    not unique.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58425
Added by nobu (Nobuyoshi Nakada) over 2 years ago

exts.mk: refine notes [Feature #13302]

  • ext/extmk.rb: split notes into header and footer, which are
    common, from bodies which are unique for each extensions.

  • template/exts.mk.tmpl: now each notes are not one line, should
    not unique.

Revision 58425
Added by nobu (Nobuyoshi Nakada) over 2 years ago

exts.mk: refine notes [Feature #13302]

  • ext/extmk.rb: split notes into header and footer, which are
    common, from bodies which are unique for each extensions.

  • template/exts.mk.tmpl: now each notes are not one line, should
    not unique.

Revision 58425
Added by nobu (Nobuyoshi Nakada) over 2 years ago

exts.mk: refine notes [Feature #13302]

  • ext/extmk.rb: split notes into header and footer, which are
    common, from bodies which are unique for each extensions.

  • template/exts.mk.tmpl: now each notes are not one line, should
    not unique.

Revision bdc6d416
Added by nobu (Nobuyoshi Nakada) over 2 years ago

ext/extmk.rb: colorize notes [Feature #13302]

  • common.mk (build-ext): pass variables to colorize.

  • ext/extmk.rb: colorize notes with tool/colorize.rb.

  • tool/colorize.rb: extract from tool/generic_erb.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58426
Added by nobu (Nobuyoshi Nakada) over 2 years ago

ext/extmk.rb: colorize notes [Feature #13302]

  • common.mk (build-ext): pass variables to colorize.

  • ext/extmk.rb: colorize notes with tool/colorize.rb.

  • tool/colorize.rb: extract from tool/generic_erb.rb.

Revision 58426
Added by nobu (Nobuyoshi Nakada) over 2 years ago

ext/extmk.rb: colorize notes [Feature #13302]

  • common.mk (build-ext): pass variables to colorize.

  • ext/extmk.rb: colorize notes with tool/colorize.rb.

  • tool/colorize.rb: extract from tool/generic_erb.rb.

Revision 58426
Added by nobu (Nobuyoshi Nakada) over 2 years ago

ext/extmk.rb: colorize notes [Feature #13302]

  • common.mk (build-ext): pass variables to colorize.

  • ext/extmk.rb: colorize notes with tool/colorize.rb.

  • tool/colorize.rb: extract from tool/generic_erb.rb.

Revision 16ffd476
Added by shyouhei (Shyouhei Urabe) over 2 years ago

NEWS entry for [Feature #13302]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58429
Added by shyouhei (Shyouhei Urabe) over 2 years ago

NEWS entry for [Feature #13302]

Revision 58429
Added by shyouhei (Shyouhei Urabe) over 2 years ago

NEWS entry for [Feature #13302]

Revision 58429
Added by shyouhei (Shyouhei Urabe) over 2 years ago

NEWS entry for [Feature #13302]

History

Updated by MSP-Greg (Greg L) over 2 years ago

Robert A. Heiler wrote:

Ruby compiles fine
Openssl also compiled fine

Just to be clear, did OpenSSL test fine, along with Ruby?

I'm a windows type, so I have no experience with your OS, but I've been doing a lot of testing lately...

Updated by rhenium (Kazuki Yamaguchi) over 2 years ago

We can know whether the system OpenSSL library is usable or not only after a miniruby is built, which is probably too late for such an option to be useful.

However I agree there are rooms for improvement. Here is the message shown when ext/*/extconf.rb fails:

configuring openssl
<snip...>
*** Following extensions failed to configure:
../.././ext/openssl/extconf.rb:0: Failed to configure openssl. It will not be installed.
*** Fix the problems, then remove these directories and try again if you want.

This is not informative about what exactly caused the failure. Actually, everything is logged to ext/*/mkmf.log, but people would never find this without googling. Maybe a change to ext/extmk.rb something like this would make it better?

From 2048a2fcb63952201f2bab404c6d01a99159449a Mon Sep 17 00:00:00 2001
From: Kazuki Yamaguchi <k@rhe.jp>
Date: Mon, 13 Mar 2017 20:47:19 +0900
Subject: [PATCH] ext/extmk.rb: mention ext/*/mkmf.log if configuring
 extensions fails

---
 ext/extmk.rb | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/ext/extmk.rb b/ext/extmk.rb
index 4317a2a8a333..931242a31d5b 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -222,7 +222,6 @@ def extmake(target, basedir = 'ext', maybestatic = true)
       rescue SystemExit
    # ignore
       rescue => error
-        lineno = error.backtrace_locations[0].lineno
         ok = false
       ensure
    rm_f "conftest*"
@@ -238,18 +237,16 @@ def extmake(target, basedir = 'ext', maybestatic = true)

       return true if !error and target.start_with?("-")

-      if parent
-        message = "Failed to configure #{target}. It will not be installed."
-      else
-        message = "Skipped to configure #{target}. Its parent is not configured."
-      end
-      if Logging.log_opened?
-        Logging::message(error.to_s) if error
-        Logging::message(message)
+      message = nil
+      if error
+        bl = error.backtrace_locations[0]
+        message = "#{bl.absolute_path}:#{bl.lineno}: #{error.message}"
+        if Logging.log_opened?
+          Logging::message("#{message}\n\t#{error.backtrace.join("\n\t")}\n")
+        end
       end
-      message = error.message if error

-      return parent ? [conf, lineno||0, message] : true
+      return [parent, message]
     end
     args = $mflags
     unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
@@ -560,7 +557,7 @@ def create_makefile(*args, &block)
   if !$nodynamic or $static
     result = extmake(d, ext_prefix, !@gemname) or abort
     extso |= $extso
-    fails << result unless result == true
+    fails << [d, result] unless result == true
   end
 end

@@ -719,15 +716,19 @@ def mf.macro(name, values, max = 70)

     mf.puts "\n""note:\n"
     unless fails.empty?
-      mf.puts %Q<\t@echo "*** Following extensions failed to configure:">
-      fails.each do |d, n, err|
-        d = "#{d}:#{n}:"
-        if err
-          err.scan(/.+/) do |ee|
-            mf.puts %Q<\t@echo "#{d} #{ee.gsub(/["`$^]/, '\\\\\\&')}">
+      mf.puts %Q<\t@echo "*** Following extensions are not compiled:">
+      fails.each do |ext, (parent, err)|
+        mf.puts %Q<\t@echo "#{ext}:">
+        if parent
+          mf.puts %Q<\t@echo "\tCould not be configured. It will not be installed.">
+          if err
+            err&.scan(/.+/) do |ee|
+              mf.puts %Q<\t@echo "\t#{ee.gsub(/["`$^]/, '\\\\\\&')}">
+            end
           end
+          mf.puts %Q<\t@echo "\tCheck #{ext_prefix}/#{ext}/mkmf.log for more details.">
         else
-          mf.puts %Q<\t@echo "#{d}">
+          mf.puts %Q<\t@echo "\tSkipped because its parent was not configured.">
         end
       end
       mf.puts %Q<\t@echo "*** Fix the problems, then remove these directories and try again if you want.">
-- 
2.12.0.248.g76c07830f945.dirty

By the way, which directories does "*** Fix the problems, then remove these directories and try again if you want." refer to?

Updated by shyouhei (Shyouhei Urabe) over 2 years ago

We looked at this issue in yesterday's developer meeting.

Kazuki's improved log seems good so please go ahead.

Another possible way proposed there was to mandate openssl installation when configure is run with --with-ext=openssl, i.e. --with-ext (which is rarely used now) to generate Makefile so that make all depends on the given extension library.

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

rhenium (Kazuki Yamaguchi) wrote:

This is not informative about what exactly caused the failure. Actually, everything is logged to ext/*/mkmf.log, but people would never find this without googling. Maybe a change to ext/extmk.rb something like this would make it better?

Could you commit it?
If I commit my patch first, you'll see conflicts.

#5

Updated by Anonymous over 2 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r58404.


extmk.rb: improve message printed when configuring extensions fails

Point to the mkmf.log if configuring an extension fails so that people
can find and fix the culprit easily. [ruby-core:80131] [Feature #13302]

Updated by rhenium (Kazuki Yamaguchi) over 2 years ago

  • Status changed from Closed to Open

shyouhei (Shyouhei Urabe) wrote:

We looked at this issue in yesterday's developer meeting.

Kazuki's improved log seems good so please go ahead.

nobu (Nobuyoshi Nakada) wrote:

rhenium (Kazuki Yamaguchi) wrote:

This is not informative about what exactly caused the failure. Actually, everything is logged to ext/*/mkmf.log, but people would never find this without googling. Maybe a change to ext/extmk.rb something like this would make it better?

Could you commit it?
If I commit my patch first, you'll see conflicts.

Thanks for review, committed as r58404.

#7

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r58412.


extmk.rb: fail for mandatory libraries

  • ext/extmk.rb: fail if a mandatory extension library failed to
    configure. [ruby-core:80759] [Feature #13302]

  • template/exts.mk.tmpl: move exit at the end.

Also available in: Atom PDF