https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112017-03-12T02:59:54ZRuby Issue Tracking SystemRuby master - Feature #13302: Provide a (force) --enable-openssl switch for ruby ./configure (or similar)https://redmine.ruby-lang.org/issues/13302?journal_id=634692017-03-12T02:59:54ZMSP-Greg (Greg L)
<ul></ul><p>Robert A. Heiler wrote:</p>
<blockquote>
<p>Ruby compiles fine<br>
Openssl also compiled fine</p>
</blockquote>
<p>Just to be clear, did OpenSSL test fine, along with Ruby?</p>
<p>I'm a windows type, so I have <strong>no experience with your OS</strong>, but I've been doing a lot of testing lately...</p> Ruby master - Feature #13302: Provide a (force) --enable-openssl switch for ruby ./configure (or similar)https://redmine.ruby-lang.org/issues/13302?journal_id=635582017-03-13T11:51:53Zrhenium (Kazuki Yamaguchi)k@rhe.jp
<ul></ul><p>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.</p>
<p>However I agree there are rooms for improvement. Here is the message shown when ext/*/extconf.rb fails:</p>
<pre><code>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.
</code></pre>
<p>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?</p>
<pre><code class="diff syntaxhl" data-language="diff"><span class="p">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
</span> extensions fails
<span class="err">
</span><span class="p">---
</span> ext/extmk.rb | 39 ++++++++++++++++++++-------------------
1 file changed, 20 insertions(+), 19 deletions(-)
<span class="err">
</span><span class="gh">diff --git a/ext/extmk.rb b/ext/extmk.rb
index 4317a2a8a333..931242a31d5b 100755
</span><span class="gd">--- a/ext/extmk.rb
</span><span class="gi">+++ b/ext/extmk.rb
</span><span class="p">@@ -222,7 +222,6 @@</span> def extmake(target, basedir = 'ext', maybestatic = true)
rescue SystemExit
# ignore
rescue => error
<span class="gd">- lineno = error.backtrace_locations[0].lineno
</span> ok = false
ensure
rm_f "conftest*"
<span class="p">@@ -238,18 +237,16 @@</span> def extmake(target, basedir = 'ext', maybestatic = true)
return true if !error and target.start_with?("-")
<span class="gd">- 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)
</span><span class="gi">+ 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
</span> end
<span class="gd">- message = error.message if error
</span>
<span class="gd">- return parent ? [conf, lineno||0, message] : true
</span><span class="gi">+ return [parent, message]
</span> end
args = $mflags
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
<span class="p">@@ -560,7 +557,7 @@</span> def create_makefile(*args, &block)
if !$nodynamic or $static
result = extmake(d, ext_prefix, !@gemname) or abort
extso |= $extso
<span class="gd">- fails << result unless result == true
</span><span class="gi">+ fails << [d, result] unless result == true
</span> end
end
<span class="p">@@ -719,15 +716,19 @@</span> def mf.macro(name, values, max = 70)
mf.puts "\n""note:\n"
unless fails.empty?
<span class="gd">- 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(/["`$^]/, '\\\\\\&')}">
</span><span class="gi">+ 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
</span> end
<span class="gi">+ mf.puts %Q<\t@echo "\tCheck #{ext_prefix}/#{ext}/mkmf.log for more details.">
</span> else
<span class="gd">- mf.puts %Q<\t@echo "#{d}">
</span><span class="gi">+ mf.puts %Q<\t@echo "\tSkipped because its parent was not configured.">
</span> end
end
mf.puts %Q<\t@echo "*** Fix the problems, then remove these directories and try again if you want.">
<span class="gd">--
</span><span class="p">2.12.0.248.g76c07830f945.dirty
</span></code></pre>
<p>By the way, which directories does "*** Fix the problems, then remove these directories and try again if you want." refer to?</p> Ruby master - Feature #13302: Provide a (force) --enable-openssl switch for ruby ./configure (or similar)https://redmine.ruby-lang.org/issues/13302?journal_id=643152017-04-18T05:52:53Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>We looked at this issue in yesterday's developer meeting.</p>
<p>Kazuki's improved log seems good so please go ahead.</p>
<p>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.</p> Ruby master - Feature #13302: Provide a (force) --enable-openssl switch for ruby ./configure (or similar)https://redmine.ruby-lang.org/issues/13302?journal_id=643892017-04-19T12:48:44Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>rhenium (Kazuki Yamaguchi) wrote:</p>
<blockquote>
<p>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?</p>
</blockquote>
<p>Could you commit it?<br>
If I commit my patch first, you'll see conflicts.</p> Ruby master - Feature #13302: Provide a (force) --enable-openssl switch for ruby ./configure (or similar)https://redmine.ruby-lang.org/issues/13302?journal_id=643902017-04-19T14:05:31ZAnonymous
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset trunk|r58404.</p>
<hr>
<p>extmk.rb: improve message printed when configuring extensions fails</p>
<p>Point to the mkmf.log if configuring an extension fails so that people<br>
can find and fix the culprit easily. <a href="/issues/13302">[ruby-core:80131]</a> [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Provide a (force) --enable-openssl switch for ruby ./configure (or similar) (Closed)" href="https://redmine.ruby-lang.org/issues/13302">#13302</a>]</p> Ruby master - Feature #13302: Provide a (force) --enable-openssl switch for ruby ./configure (or similar)https://redmine.ruby-lang.org/issues/13302?journal_id=643912017-04-19T14:07:07Zrhenium (Kazuki Yamaguchi)k@rhe.jp
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Open</i></li></ul><p>shyouhei (Shyouhei Urabe) wrote:</p>
<blockquote>
<p>We looked at this issue in yesterday's developer meeting.</p>
<p>Kazuki's improved log seems good so please go ahead.</p>
</blockquote>
<p>nobu (Nobuyoshi Nakada) wrote:</p>
<blockquote>
<p>rhenium (Kazuki Yamaguchi) wrote:</p>
<blockquote>
<p>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?</p>
</blockquote>
<p>Could you commit it?<br>
If I commit my patch first, you'll see conflicts.</p>
</blockquote>
<p>Thanks for review, committed as r58404.</p> Ruby master - Feature #13302: Provide a (force) --enable-openssl switch for ruby ./configure (or similar)https://redmine.ruby-lang.org/issues/13302?journal_id=643982017-04-20T08:13:23Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset trunk|r58412.</p>
<hr>
<p>extmk.rb: fail for mandatory libraries</p>
<ul>
<li>
<p>ext/extmk.rb: fail if a mandatory extension library failed to<br>
configure. <a href="/issues/13302">[ruby-core:80759]</a> [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Provide a (force) --enable-openssl switch for ruby ./configure (or similar) (Closed)" href="https://redmine.ruby-lang.org/issues/13302">#13302</a>]</p>
</li>
<li>
<p>template/exts.mk.tmpl: move <code>exit</code> at the end.</p>
</li>
</ul>