https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112013-05-14T00:38:42ZRuby Issue Tracking SystemRuby master - Bug #8400: skip `Rinda::TestRingFinger` tests on platforms not implementing `getifaddrs()`https://bugs.ruby-lang.org/issues/8400?journal_id=393102013-05-14T00:38:42Zjonforums (Jon Forums)
<ul></ul><p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/9">@usa (Usaku NAKAMURA)</a>, nice...just scanning r40693 :) :)</p>
<p>Looks like NET_LUID redef when using mingw-w64 headers is cause of this fail</p>
<p><a href="http://ci.rubyinstaller.org/view/Ruby%20Trunk/job/ruby-trunk-x86-build/1514/console" class="external">http://ci.rubyinstaller.org/view/Ruby%20Trunk/job/ruby-trunk-x86-build/1514/console</a></p>
<p>Mingw-w64 headers do this</p>
<p>L14: <a href="http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/tags/v2.0.6/mingw-w64-headers/include/iptypes.h?revision=5856&view=markup" class="external">http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/tags/v2.0.6/mingw-w64-headers/include/iptypes.h?revision=5856&view=markup</a><br>
L87: <a href="http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/tags/v2.0.6/mingw-w64-headers/include/ifdef.h?revision=5856&view=markup" class="external">http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/tags/v2.0.6/mingw-w64-headers/include/ifdef.h?revision=5856&view=markup</a></p>
<p>Haven't looked at mingw.org or msvc headers to see if simple #ifdef for mingw-w64 would be a potential fix.</p> Ruby master - Bug #8400: skip `Rinda::TestRingFinger` tests on platforms not implementing `getifaddrs()`https://bugs.ruby-lang.org/issues/8400?journal_id=393112013-05-14T03:07:13Zjonforums (Jon Forums)
<ul></ul><p>test file build results with 32bit compilers => cl, mingw.org 4.2.6, mingw-w64 4.7.2, mingw-w64 4.8.0</p>
<p><a href="https://gist.github.com/jonforums/5570163" class="external">https://gist.github.com/jonforums/5570163</a></p> Ruby master - Bug #8400: skip `Rinda::TestRingFinger` tests on platforms not implementing `getifaddrs()`https://bugs.ruby-lang.org/issues/8400?journal_id=393282013-05-14T13:08:58Zjonforums (Jon Forums)
<ul></ul><p>usa, below is the quick patch I needed in order to build on win7 32bit with mingw-w64 gcc 4.7.4. The patch solved the <code>make test-all</code><br>
failures and <code>make test</code> still passed.</p>
<h3>
<code>make test-all</code> results</h3>
<p>...<br>
[11522/13375] TestSprintf#test_float = 0.00 s<br>
72) Failure:<br>
TestSprintf#test_float [c:/Users/Jon/Documents/RubyDev/ruby-git/test/ruby/test_sprintf.rb:193]:<br>
<a href="/issues/4034">[ruby-dev:42551]</a>.<br>
<"0x1p+2"> expected but was<br>
<"0x1p+1">.</p>
<p>Finished tests in 847.472473s, 15.7822 tests/s, 2649.6365 assertions/s.<br>
13375 tests, 2245494 assertions, 1 failures, 0 errors, 101 skips</p>
<p>ruby -v: ruby 2.1.0dev (2013-05-14 trunk 40710) [i386-mingw32]<br>
make: *** [yes-test-all] Error 1</p>
<h3>
<code>make test</code> results</h3>
<p>...<br>
gcc version 4.7.3 (rubenvb-4.7.4-release)<br>
sample/test.rb:gc OK 4 27K 1210 62<br>
test succeeded<br>
PASS all 964 tests<br>
...<br>
Driver is ruby 2.1.0dev (2013-05-14 trunk 40710) [i386-mingw32]<br>
Target is ruby 2.1.0dev (2013-05-14 trunk 40710) [i386-mingw32]</p>
<p>KNOWNBUGS.rbPASS 0<br>
No tests, no problem</p>
<p>The first hunk below is a throwaway hack to fix the problem that <code>if_nametoindex</code> in <code>ext/socket/ifaddr.c:143</code> is only available on<br>
vista or greater. In the current rubyinstaller recipes we currently define -D_WIN32_WINNT=0x501 so without this hunk I get link<br>
errors.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb408409%28v=vs.85%29.aspx" class="external">http://msdn.microsoft.com/en-us/library/windows/desktop/bb408409%28v=vs.85%29.aspx</a></p>
<p>I believe the second hunk is more robust than r40721 because it appears that your <code>NET_LUID</code> struct is needed only by mingw.org<br>
toolchains, not msvc or mingw-w64. I don't know when I'll next have time to look at this, but plan to check that that the second<br>
hunk is valid and works on my mingw.org toolchain.</p>
<p>Given the os version issues with <code>if_nametoindex</code> I think the real fix is an emulation function similar to what cygwin does. Likely<br>
an <code>#ifdef _WIN32_WINNT >= 0x600</code> that uses the real <code>if_nametoindex</code> and falls back to an emulated fcn.</p>
<p>What do you think?</p>
<p>diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb<br>
index 88e7366..b7810d0 100644<br>
--- a/ext/socket/extconf.rb<br>
+++ b/ext/socket/extconf.rb<br>
@@ -442,7 +442,7 @@ EOF</p>
<p>if ipv6<br>
if $mingw</p>
<ul>
<li>
<pre><code> $CPPFLAGS << " -D_WIN32_WINNT=0x501" unless $CPPFLAGS.include?("_WIN32_WINNT")
</code></pre>
</li>
</ul>
<ul>
<li>
<pre><code> $CPPFLAGS << " -D_WIN32_WINNT=0x601"
</code></pre>
end<br>
ipv6lib = nil<br>
class << (fmt = "unknown")<br>
diff --git a/win32/win32.c b/win32/win32.c<br>
index 2489942..f3d4b2c 100644<br>
--- a/win32/win32.c<br>
+++ b/win32/win32.c<br>
@@ -3762,7 +3762,7 @@ str2guid(const char *str, GUID *guid)<br>
}</li>
</ul>
<p>/* License: Ruby's */<br>
-#ifndef <em>IFDEF</em><br>
+#if !defined(_MSC_VER) && !defined(__MINGW64_VERSION_MAJOR)<br>
typedef struct {<br>
uint64_t Value;<br>
struct {</p> Ruby master - Bug #8400: skip `Rinda::TestRingFinger` tests on platforms not implementing `getifaddrs()`https://bugs.ruby-lang.org/issues/8400?journal_id=393332013-05-14T23:22:50Zjonforums (Jon Forums)
<ul></ul><p>Related, should windows-specific implementation for this issue be moved from win32.c to a networking specific<br>
file (win32/net.c ?) and the build scripts updated similar to what Shirosaki-san did for win32/file.c?</p>
<p>win32.c is a 150k, 6900 line pandora's box of awesomeness, and I'm for putting it on a diet.</p> Ruby master - Bug #8400: skip `Rinda::TestRingFinger` tests on platforms not implementing `getifaddrs()`https://bugs.ruby-lang.org/issues/8400?journal_id=447132014-01-30T01:57:47Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Target version</strong> changed from <i>2.1.0</i> to <i>2.2.0</i></li></ul> Ruby master - Bug #8400: skip `Rinda::TestRingFinger` tests on platforms not implementing `getifaddrs()`https://bugs.ruby-lang.org/issues/8400?journal_id=693102018-01-05T21:00:40Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Target version</strong> deleted (<del><i>2.2.0</i></del>)</li></ul> Ruby master - Bug #8400: skip `Rinda::TestRingFinger` tests on platforms not implementing `getifaddrs()`https://bugs.ruby-lang.org/issues/8400?journal_id=805512019-08-10T04:42:40Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>Backport</strong> deleted (<del><i>1.9.3: UNKNOWN, 2.0.0: UNKNOWN</i></del>)</li></ul><p>This should be fixed by <a class="changeset" title="test_rinda.rb: fix for unimplemented ifindex() * test/rinda/test_rinda.rb (RingIPv6#prepare_ipv6..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/66ee8a17852bb7657712afd3ac088a8b9b293d71">66ee8a17852bb7657712afd3ac088a8b9b293d71</a>;</p>