https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112010-05-01T15:45:34ZRuby Issue Tracking SystemRuby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=106842010-05-01T15:45:34Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>=begin<br>
Hi,</p>
<p>At Sat, 1 May 2010 15:12:35 +0900,<br>
Charlie Savage wrote in <a href="/issues/3231">[ruby-core:29911]</a>:</p>
<blockquote>
<p>Since extconf.h is never passed to the compiler, the error<br>
happens. Adding this to the top of the file:</p>
</blockquote>
<p>CPPFLAGS should have -DRUBY_EXTCONF_H="$(RUBY_EXTCONF_H)",<br>
and include/ruby/ruby.h has</p>
<p>#ifdef RUBY_EXTCONF_H<br>
#include RUBY_EXTCONF_H<br>
#endif</p>
<p>How is CPPFLAGS defined in Makefile?</p>
<p>--<br>
Nobu Nakada</p>
<p>=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=107732010-05-04T13:33:12Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li></ul><p>=begin</p>
<p>=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=108412010-05-07T04:31:03Zcfis (Charlie Savage)
<ul><li><strong>File</strong> <a href="/attachments/978">Makefile</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/978/Makefile">Makefile</a> added</li></ul><p>=begin<br>
Ok, I see what is happening. The include is pulling in digest/extconf.h, not digest/md5/extconf.h. Thus the compile breaks.</p>
<p>The makefile has this:</p>
<p>CPPFLAGS = -DRUBY_EXTCONF_H="$(RUBY_EXTCONF_H)"</p>
<p>Include/ruby/ruby.h (in the source tree) has this:</p>
<p>#ifdef RUBY_EXTCONF_H<br>
#include RUBY_EXTCONF_H<br>
#endif</p>
<p>But if you do this:</p>
<p>cd /ext/digest/md5<br>
nmake</p>
<p>Then for whatever reason the wrong extconf.h file is being used.</p>
<p>Attaching the generated makefile if it helps.</p>
<p>=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=108652010-05-08T03:37:26Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Category</strong> set to <i>ext</i></li></ul><p>=begin<br>
Could you show an mkmf.log?<br>
And from where have you installed OpenSSL?<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=108782010-05-09T08:12:26Zcfis (Charlie Savage)
<ul><li><strong>File</strong> <a href="/attachments/979">mkmf.log</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/979/mkmf.log">mkmf.log</a> added</li><li><strong>File</strong> <a href="/attachments/980">Makefile</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/980/Makefile">Makefile</a> added</li></ul><p>=begin<br>
Sure, attached.</p>
<p>OpenSSL (v1.0) is installed to c:\Development\msys\local\bin and c:\Development\msys\local\include.</p>
<p>This is where I have other 3rd party libraries installed (iconv, zlib, libxml, etc.) and those extensions build fine as does the openssl extension. So this isn't a path issue.<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=108882010-05-09T15:50:55Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>=begin<br>
Hi,</p>
<p>At Sun, 9 May 2010 08:12:27 +0900,<br>
Charlie Savage wrote in <a href="https://blade.ruby-lang.org/ruby-core/30108">[ruby-core:30108]</a>:</p>
<blockquote>
<p>OpenSSL (v1.0) is installed to c:\Development\msys\local\bin<br>
and c:\Development\msys\local\include.</p>
</blockquote>
<p>How were those directory names given to the compiler? The<br>
mkmf.log doesn't seem contain them.</p>
<p>have_library: checking for main() in crypto.lib... -------------------- yes<br>
"cl -nologo -Feconftest -I../../../.ext/include/i386-mswin32_100 -I../../.././include -I../../.././ext/digest/md5 -I../../.././ext/digest/md5/.. -I../../.././include -MD -Zi -W2 -wd4996 -Od -Zm600 conftest.c msvcr100-ruby191-static.lib crypto.lib unicows.lib oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib -link -incremental:no -debug -opt:ref -opt:icf -libpath:. -libpath:../../.. "</p>
<p>have_header: checking for openssl/md5.h... -------------------- yes<br>
"cl -nologo -I../../../.ext/include/i386-mswin32_100 -I../../.././include -I../../.././ext/digest/md5 -I../../.././ext/digest/md5/.. -MD -Zi -W2 -wd4996 -Od -Zm600 -c conftest.c"</p>
<p>And from where have you downloaded and installed that OpenSSL?</p>
<p>--<br>
Nobu Nakada</p>
<p>=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=109052010-05-10T13:17:34Zcfis (Charlie Savage)
<ul></ul><p>=begin</p>
<ol>
<li>Open VC command prompt.</li>
<li>set INCLUDE=c:\Development\msys\local\include;%INCLUDE%</li>
<li>set LIB=c:\Development\msys\local\lib;%LIB%</li>
<li>cd c:\Development\src\ruby</li>
<li>nmake</li>
</ol>
<p>(Note I have previously run win32/configure.bat)</p>
<p>Note the openssl includes and libs are being found just fine as you can see in mkmf.log<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=110222010-05-14T07:32:12Zcfis (Charlie Savage)
<ul></ul><p>=begin<br>
Missed the openssl question. Its the official release, from <a href="http://www.openssl.org/source" class="external">http://www.openssl.org/source</a>. Builds fine, and works fine with the openssl extension as previously noted. And works fine with digest too with including extconf.h from the digest directory (versus the parent directory).<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=112942010-05-28T00:19:56Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul></ul><p>=begin<br>
Does this patch help you?<br>
(only ext/digest/md5)</p>
<a name="Index-extdigestmd5extconfrb"></a>
<h1 >Index: ext/digest/md5/extconf.rb<a href="#Index-extdigestmd5extconfrb" class="wiki-anchor">¶</a></h1>
<p>--- ext/digest/md5/extconf.rb (revision 28034)<br>
+++ ext/digest/md5/extconf.rb (working copy)<br>
@@ -4,7 +4,6 @@<br>
require "mkmf"</p>
<p>$defs << "-DHAVE_CONFIG_H"<br>
-$INCFLAGS << " -I$(srcdir)/.."</p>
<p>$objs = [ "md5init.#{$OBJEXT}" ]</p>
<a name="Index-extdigestmd5md5initc"></a>
<h1 >Index: ext/digest/md5/md5init.c<a href="#Index-extdigestmd5md5initc" class="wiki-anchor">¶</a></h1>
<p>--- ext/digest/md5/md5init.c (revision 28034)<br>
+++ ext/digest/md5/md5init.c (working copy)<br>
@@ -1,7 +1,7 @@<br>
/* $RoughId: md5init.c,v 1.2 2001/07/13 19:49:10 knu Exp $ <em>/<br>
/</em> $Id$ */</p>
<h1>-#include "digest.h"<br>
+#include "../digest.h"<br>
#if defined(HAVE_OPENSSL_MD5_H)<br>
#include "md5ossl.h"<br>
#else<br>
Index: ext/digest/md5/md5.h</h1>
<p>--- ext/digest/md5/md5.h (revision 28034)<br>
+++ ext/digest/md5/md5.h (working copy)<br>
@@ -46,7 +46,7 @@<br>
#ifndef MD5_INCLUDED</p>
<a name="define-MD5_INCLUDED"></a>
<h1 >define MD5_INCLUDED<a href="#define-MD5_INCLUDED" class="wiki-anchor">¶</a></h1>
<p>-#include "defs.h"<br>
+#include "../defs.h"</p>
<p>/*</p>
<ul>
<li>This code has some adaptations for the Ghostscript environment, but it</li>
</ul>
<p>=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=114822010-06-06T16:19:21Zcfis (Charlie Savage)
<ul></ul><p>=begin<br>
Yes - it does fix the issue for md5. Can this also be done for the other digest subdirectories?</p>
<p>Thanks for the help.</p>
<p>=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=116482010-06-12T14:24:55Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Open</i></li><li><strong>Assignee</strong> set to <i>usa (Usaku NAKAMURA)</i></li><li><strong>Target version</strong> set to <i>1.9.2</i></li></ul><p>=begin<br>
Hi, Usaku</p>
<p>Could you please commit your patch?</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a><br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=116632010-06-14T10:09:16Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> changed from <i>usa (Usaku NAKAMURA)</i> to <i>knu (Akinori MUSHA)</i></li></ul><p>=begin<br>
This patch shows only concept to fix.<br>
The maintainer should think how to do now. It's not my task.<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=116702010-06-14T18:58:30Zknu (Akinori MUSHA)knu@ruby-lang.org
<ul></ul><p>=begin<br>
I'll handle this.</p>
<p>This fix is okay for me because defs.h is intended to be for internal use inside ext/digest/.<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=116712010-06-14T20:15:11Zknu (Akinori MUSHA)knu@ruby-lang.org
<ul></ul><p>=begin<br>
I think I misread the patch.<br>
Digest submodules should be able to include digest.h without having to use a relative path form, while that's not the case for defs.h.</p>
<p>Let me think awhile about what the real problem is here.<br>
I won't object to putting the proposed fix into ruby_1_9_2 for the forthcoming release, but for trunk as a permanent fix I'm not quite convinced.<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=116722010-06-14T21:00:36Zknu (Akinori MUSHA)knu@ruby-lang.org
<ul><li><strong>File</strong> <a href="/attachments/1035">dotdotslash.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1035/dotdotslash.patch">dotdotslash.patch</a> added</li></ul><p>=begin</p>
<p>=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=116802010-06-15T09:19:59Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul></ul><p>=begin<br>
In building process, both ext/digest/extconf.h and ext/digest/md5/extconf.h exist.<br>
If you specify -I.. in ext/digest/md5 and #include <extconf.h>, compiler cannot<br>
decide to include whether ext/digest/extconf.h or ext/digest/md5/extconf.h.</p>
<p>Gcc gives priority to the place specified by the rear -I, but of course this<br>
behavior is not the spec of any standards. It's merely implementation dependence.<br>
And, VC10 actually shows different behavior.<br>
This is the real problem.</p>
<p>My conclusion is that you should specify to complier what do you actually want<br>
to include.<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=116832010-06-15T12:45:19Zknu (Akinori MUSHA)knu@ruby-lang.org
<ul></ul><p>=begin<br>
Thanks so much for the detailed explanation. Can I ask you something? Does VC++ search directories in random order, or does it work under any specific rules that changed in VC++ 2010?</p>
<p>In Unix, there is a spec in SUS that the order of specifying -I/-L options is significant for the compiler commands, and they shall search directories named in those options in the order specified.<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=117092010-06-17T04:12:51Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Target version</strong> changed from <i>1.9.2</i> to <i>2.0.0</i></li></ul><p>=begin<br>
Hi,</p>
<p>2010/6/15 Akinori MUSHA <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a>:</p>
<blockquote>
<p>Thanks so much for the detailed explanation. ?Can I ask you something? ?Does VC++ search directories in random order, or does it work under any specific rules that changed in VC++ 2010?</p>
<p>In Unix, there is a spec in SUS that the order of specifying -I/-L options is significant for the compiler commands, and they shall search directories named in those options in the order specified.</p>
</blockquote>
<p><a href="http://msdn.microsoft.com/ja-jp/library/36k2cdd4.aspx" class="external">http://msdn.microsoft.com/ja-jp/library/36k2cdd4.aspx</a></p>
<p>The preprocessor searches for include files in the following order:</p>
<pre><code> 1. In the same directory as the file that contains the #include statement.
2. In the directories of any previously opened include files in the reverse order in which they were opened. The search starts from the directory of the include file that was opened last and continues through the directory of the include file that was opened first.
3. Along the path specified by each /I compiler option.
4. Along the paths specified by the INCLUDE environment variable.
</code></pre>
<p>The 2 seems to cause this issue.</p>
<p>BTW, knu seemed to apply Usaku's patch at r28341 to ruby_1_9_2 branch,<br>
so this issue would not occur in ruby_1_9_2. I set this ticket to<br>
1.9.x.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a><br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=117322010-06-17T21:15:18Zknu (Akinori MUSHA)knu@ruby-lang.org
<ul></ul><p>=begin<br>
Thanks for the info. Can you or anyone please check if the clause 2 is new in VC++ 2010?<br>
If that's the case, isn't there any compatibility option we can use to restore the old behavior?</p>
<p>I still hope this is a bug which will eventually be fixed.<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=130632010-08-29T07:04:16Zcfis (Charlie Savage)
<ul></ul><p>=begin<br>
Just to follow up on this - I am unfortunately still seeing the same problem in ruby 1.9.2 with VC++ 2010.</p>
<pre><code> cl -nologo -LD -Fe../../../.ext/i386-mswin32_100/digest/md5.so md5init.obj md5ossl.obj msvcr100-ruby191.lib crypto.lib unicows.lib oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib -link -incremental:no -debug -opt:ref -opt:icf -incremental:no -debug -opt:ref -opt:icf -dll -libpath:. -libpath:../../.. -implib:md5-i386-mswin32_100.lib -pdb:md5-i386-mswin32_100.pdb -def:md5-i386-mswin32_100.def
Creating library md5-i386-mswin32_100.lib and object md5-i386-mswin32_100.exp
</code></pre>
<p>md5init.obj : error LNK2001: unresolved external symbol _rb_Digest_MD5_Finish<br>
md5init.obj : error LNK2001: unresolved external symbol _rb_Digest_MD5_Update<br>
md5init.obj : error LNK2001: unresolved external symbol _rb_Digest_MD5_Init<br>
../../../.ext/i386-mswin32_100/digest/md5.so : fatal error LNK1120: 3 unresolved externals<br>
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'<br>
Stop.<br>
=end</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=177232011-06-11T15:01:54Zko1 (Koichi Sasada)
<ul></ul><p>Who should handle this ticket?</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=184922011-06-26T19:29:56Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Assignee</strong> changed from <i>knu (Akinori MUSHA)</i> to <i>nahi (Hiroshi Nakamura)</i></li></ul> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=185152011-06-26T23:29:57Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul><li><strong>Target version</strong> changed from <i>2.0.0</i> to <i>1.9.3</i></li></ul> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=186742011-06-29T22:50:54Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Feedback</i></li></ul><p>Charlie, I heard that it doesn't happen for Usaku at present. Do you still suffer by this problem? Can you narrow down conditions how it happens?</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=205592011-09-04T10:01:14Zcfis (Charlie Savage)
<ul></ul><p>This can be closed, it no longer happens.</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=205692011-09-04T23:44:55Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Rejected</i></li></ul><p>Thanks for the confirmation. Closing this ticket as 'Works for me'.</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=550232015-11-21T04:37:49Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Rejected</i> to <i>Closed</i></li><li><strong>Backport</strong> set to <i>2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED</i></li></ul> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=550572015-11-24T15:30:22Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED</i> to <i>2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE</i></li></ul><p>Backported into <code>ruby_2_2</code> branch at r52739.<br>
Add similar patch to ext/digest/sha2_sha2ossl.c.</p> Ruby master - Bug #3231: Digest Does Not Buildhttps://bugs.ruby-lang.org/issues/3231?journal_id=551552015-11-30T12:08:45Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Backport</strong> changed from <i>2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE</i> to <i>2.0.0: REQUIRED, 2.1: DONE, 2.2: DONE</i></li></ul><p>ruby_2_1 r52797 merged revision(s) 52694.</p>