https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112012-10-19T13:27:32ZRuby Issue Tracking SystemBackport193 - Backport #7174: Advocating for backporting 36811https://redmine.ruby-lang.org/issues/7174?journal_id=310412012-10-19T13:27:32Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>h.shirosaki (Hiroshi Shirosaki)</i></li></ul><p>Shirosaki-san, can you make a patch for 1.9.3?<br>
The base of r36811 is too far from 1.9.3.</p> Backport193 - Backport #7174: Advocating for backporting 36811https://redmine.ruby-lang.org/issues/7174?journal_id=311032012-10-19T22:53:20Zjonforums (Jon Forums)
<ul></ul><p>Redmine is misbehaving.</p>
<p>Hiroshi...if it makes things simpler, please feel free to do a manual sync from a local svn repo to the tcs github repo so it's easy to rebase your current <code>win-file-trunk\ruby_1_9_3</code> on top of the latest ruby_1_9_3. Don't worry about the other tcs patch branches being misaligned. I'll clean them up this weekend.</p>
<p>I'm in meetings all day, but had planned to tweak one of these two svn -> git sync scripts to sync trunk and ruby_1_9_3 between local svn repos (Jenkins workspace) and a local tcs-ruby git repo and push to gh.</p>
<p><a href="https://gist.github.com/3907291" class="external">https://gist.github.com/3907291</a><br>
<a href="https://bitbucket.org/jcreenaune/svn-git-mirror/src" class="external">https://bitbucket.org/jcreenaune/svn-git-mirror/src</a></p>
<blockquote>
<p>Issue <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: Advocating for backporting 36811 (Closed)" href="https://redmine.ruby-lang.org/issues/7174">#7174</a> has been updated by usa (Usaku NAKAMURA).</p>
<p>Status changed from Open to Assigned<br>
Assignee set to h.shirosaki (Hiroshi Shirosaki)</p>
<h2>Shirosaki-san, can you make a patch for 1.9.3?<br>
The base of r36811 is too far from 1.9.3.</h2>
<p>Backport <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: Advocating for backporting 36811 (Closed)" href="https://redmine.ruby-lang.org/issues/7174">#7174</a>: Advocating for backporting 36811<br>
<a href="https://bugs.ruby-lang.org/issues/7174#change-31041" class="external">https://bugs.ruby-lang.org/issues/7174#change-31041</a></p>
<p>Author: jonforums (Jon Forums)<br>
Status: Assigned<br>
Priority: Normal<br>
Assignee: h.shirosaki (Hiroshi Shirosaki)<br>
Category:<br>
Target version:</p>
<p>Please consider backporting 36811 and refinements for the following reasons:</p>
<ol>
<li>While it's debatable whether this patch fixes a Windows platform bug in the 1.9.x<br>
series or whether it's a performance refactoring, it is a fact that this patch<br>
fixes long-standing 1.9.x usability problems important to many Ruby on Windows users.</li>
</ol>
<p><a href="https://gist.github.com/3242245" class="external">https://gist.github.com/3242245</a></p>
<ol start="2">
<li>
<p>For many months Hiroshi has maintained a 1.9.3 backport of this functionality,<br>
with the latest version available at <a href="https://github.com/thecodeshop/ruby/tree/win-file-trunk/ruby_1_9_3" class="external">https://github.com/thecodeshop/ruby/tree/win-file-trunk/ruby_1_9_3</a><br>
This functionality has been part of multiple tcs-ruby experimental releases over the<br>
last 6-9 months.</p>
</li>
<li>
<p>While the functionality has been tested on 1.9.3 via tcs-ruby by many interested<br>
devs over many months, tcs-ruby is not (and will never be) an alternative MRI distribution.<br>
tcs-ruby's sole purpose is to be collaboration repo and proving ground for those<br>
interested in contributing Windows and cross-platform improvements to MRI. tcs-ruby's<br>
goal is to refine the improvements and make them available for easy inclusion into MRI.</p>
</li>
<li>
<p>As a consequence of (3), Hiroshi's 1.9.3 backports have not had as much<br>
widespread testing as they would have if they were included in an official<br>
RubyInstaller release. This was a purposeful decision on our part. RubyInstaller<br>
releases are meant to track official ruby-core releases. They are meant to be stable,<br>
not experimental releases.</p>
</li>
</ol>
<p>As this fix is now on trunk, and will be available in the 2.0.0 release targeted<br>
for February, I strongly believe it's time to make the functionality available in the<br>
next 1.9.3 patch release (and RubyInstaller release) in order to get more widespread usage.</p>
<p>By backporting this functionality to the next 1.9.3 patch release and getting more usage<br>
(and potentially, further refinements) we minimize risks and help enhance the smooth adoption of 2.0.0.</p>
<p>--<br>
<a href="http://bugs.ruby-lang.org/" class="external">http://bugs.ruby-lang.org/</a></p>
</blockquote>
<p>Jon</p>
<hr>
<p>Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat.<br>
<a href="http://thecodeshop.github.com" class="external">http://thecodeshop.github.com</a> | <a href="http://jonforums.github.com/" class="external">http://jonforums.github.com/</a><br>
twitter: <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/825">@jonforums (Jon Forums)</a></p> Backport193 - Backport #7174: Advocating for backporting 36811https://redmine.ruby-lang.org/issues/7174?journal_id=311042012-10-19T23:59:12Zh.shirosaki (Hiroshi Shirosaki)h.shirosaki@gmail.com
<ul></ul><p>On Fri, Oct 19, 2012 at 1:27 PM, usa (Usaku NAKAMURA)<br>
<a href="mailto:usa@garbagecollect.jp" class="email">usa@garbagecollect.jp</a> wrote:</p>
<blockquote>
<p>Shirosaki-san, can you make a patch for 1.9.3?<br>
The base of r36811 is too far from 1.9.3.</p>
</blockquote>
<p>I've rebased on the top of r37266. Recent revisions don't conflict.<br>
I added two commits.</p>
<p><a href="https://github.com/thecodeshop/ruby/commits/win-file-trunk/ruby_1_9_3" class="external">https://github.com/thecodeshop/ruby/commits/win-file-trunk/ruby_1_9_3</a><br>
(I also updated ruby_1_9_3.)</p>
<p>Revisions:<br>
r34849,r34853,r34854,r34855,r34859,r34862,r35384,r35385,r36811,r36812,r36850,r36907,r36908</p>
<p>Patch:<br>
<a href="https://github.com/thecodeshop/ruby/compare/ruby_1_9_3...win-file-trunk/ruby_1_9_3.diff" class="external">https://github.com/thecodeshop/ruby/compare/ruby_1_9_3...win-file-trunk/ruby_1_9_3.diff</a><br>
<a href="https://gist.github.com/3918535" class="external">https://gist.github.com/3918535</a></p>
<p>I confirmed make, make test and make test-all with the following<br>
environments. It seems fine.<br>
x86_64-darwin12.2.0, i386-mingw32, x64-mswin64</p>
<p>ruby 1.9.3p297 [i386-mingw32] on Win7<br>
has two failures. Other fixes will be required for those.</p>
<ol>
<li>
<p>Failure:<br>
test_getpwuid(TestEtc) [c:/Users/hiroshi/work/ruby/test/etc/test_etc.rb:42]:<br>
Expected [] to include nil.</p>
</li>
<li>
<p>Failure:<br>
test_generate_bin_bindir_with_user_install_warning(TestGemInstaller)<br>
[c:/Users/hiroshi/work/ruby/test/rubygems/test_gem_<br>
installer.rb:247]:<br>
--- expected<br>
+++ actual<br>
@@ -1 +1,3 @@<br>
-""<br>
+"WARNING: You don't have C:\Windows in your PATH,<br>
+\t gem executables will not run.<br>
+"</p>
</li>
</ol>
<p>10356 tests, 1909402 assertions, 2 failures, 0 errors, 94 skips</p>
<p>r36636 will fix test_getpwuid failure.<br>
r37048 will fix test_generate_bin_bindir_with_user_install_warning failure.<br>
r37032 will fix parallel test-all failure.</p>
<a name="Thank-you"></a>
<h2 >Thank you.<a href="#Thank-you" class="wiki-anchor">¶</a></h2>
<p>Hiroshi Shirosaki</p> Backport193 - Backport #7174: Advocating for backporting 36811https://redmine.ruby-lang.org/issues/7174?journal_id=315082012-10-25T17:16:38Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r37321.<br>
Jon, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<p>merge revision(s) 34849,34853,34854,34855,34859,34862,35384,35385,36811,36812,36850,36907,36908: [Backport <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: Advocating for backporting 36811 (Closed)" href="https://redmine.ruby-lang.org/issues/7174">#7174</a>]</p>
<pre><code>* Makefile.in (PLATFORM_DIR): add a variable for `win32` directory.
* Makefile.in (clean-platform): add new target.
It cleans `win32` directory.
* common.mk (clean): add a dependency for `win32` directory.
* common.mk (distclean): ditto.
* common.mk (distclean-platform): add new target.
It cleans `win32` directory.
* common.mk ($(PLATFORM_D)): add new target to make `win32` directory.
* common.mk (win32/win32.$(OBJEXT)): move win32.o into `win32`
directory.
* common.mk (win32/file.$(OBJEXT)): add new target for win32/file.c.
* configure.in: move win32.o into `win32` directory and add
win32/file.o to MISSING.
* file.c (file_load_ok, rb_file_load_ok): replace static
file_load_ok() with public rb_file_load_ok().
It's to link Windows implementation in win32/file.c.
* file.c (rb_find_file_ext_safe): ditto.
* file.c (rb_find_file_safe): ditto.
* win32/file.c (rb_file_load_ok): new file. Add Windows specific
optimized implementation of rb_file_load_ok(). We created a
separated file to avoid too many #ifdef macro which is unreadable.
* win32/Makefile.sub (PLATFORM_DIR): add a variable for `win32`
directory.
* win32/Makefile.sub (MISSING): move win32.obj into `win32`
directory and add win32/file.obj to MISSING.
* win32/Makefile.sub (MAKEDIRS): replace MINIRUBY with BASERUBY.
It's because miniruby doesn't exist when making `win32` directory.
* win32/Makefile.sub (clean-platform): add new target to clean `win32`
directory.
* win32/Makefile.sub ({$(srcdir)}.c{}.obj): make it not match
win32/file.c to build properly.
* win32/Makefile.sub (win32/win32.$(OBJEXT)): move win32.obj into
`win32` directory.
Patch created with Luis Lavena.
<a href="/issues/5999">[ruby-core:42480]</a> [Feature #5999]
* win32/Makefile.sub (MAKEDIRS): use mkdir of cmd.exe instead of ruby.
[Bug #6103] <a href="/issues/6103">[ruby-core:43012]</a>
* win32/README.win32: added a notice about command extension of cmd.exe.
* win32/makedirs.bat: new command to make intermediate
directories, and not to report any errors if the directory
already exists.
* win32/Makefile.sub (MAKEDIRS): enable command extensions.
* win32/file.c (INVALID_FILE_ATTRIBUTES): define for old SDK.
* configure.in (mingw): add shlwapi to the list of dependency
libs for Windows.
* win32/Makefile.sub (EXTSOLIBS): ditto.
* internal.h: declare internal functions rb_w32_init_file,
rb_file_expand_path_internal and rb_file_expand_path_fast.
* file.c (Init_File): invoke Windows initialization rb_w32_init_file
* win32/file.c (rb_file_load_path_internal): new function.
Windows-specific implementation that replaces file_expand_path.
[Bug #6836]<a href="/issues/6836">[ruby-core:46996]</a>
* win32/file.c (rb_w32_init_file): new function. Initialize codepage
cache for faster conversion encodings lookup.
* file.c (file_expand_path): rename to rb_file_expand_path_internal.
Conditionally exclude from Windows.
* file.c (rb_file_expand_path_fast): new function. delegates to
rb_file_expand_path_internal without performing a hit to the
filesystem.
* file.c (file_expand_path_1): use rb_file_expand_path_internal without
path expansion (used by require).
* file.c (rb_find_file_ext_safe): ditto.
* file.c (rb_find_file_safe): ditto.
* load.c (rb_get_expanded_load_path): use rb_file_expand_path_fast.
* load.c (rb_feature_provided): ditto.
* file.c (rb_file_expand_path): use rb_file_expand_path_internal with
path expansion.
* file.c (rb_file_absolute_path): ditto.
* test/ruby/test_file_exhaustive.rb: new tests to exercise
rb_file_expand_path_internal implementation and compliance with
existing behaviors.
* test/ruby/test_file_exhaustive.rb: fix test introduced in r36811 for
posix environments where HOME is not defined. <a href="https://blade.ruby-lang.org/ruby-core/47322">[ruby-core:47322]</a>
</code></pre> Backport193 - Backport #7174: Advocating for backporting 36811https://redmine.ruby-lang.org/issues/7174?journal_id=315732012-10-25T22:38:02Zh.shirosaki (Hiroshi Shirosaki)h.shirosaki@gmail.com
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Assigned</i></li><li><strong>Assignee</strong> changed from <i>h.shirosaki (Hiroshi Shirosaki)</i> to <i>usa (Usaku NAKAMURA)</i></li></ul><p>Thank you very much for backport!</p>
<p>But I noticed the following failure occurs.</p>
<p><a href="http://u64.rubyci.org/~chkbuild/ruby-1.9.3/log/20121025T112858Z.log.html.gz" class="external">http://u64.rubyci.org/~chkbuild/ruby-1.9.3/log/20121025T112858Z.log.html.gz</a></p>
<ol start="28">
<li>Error:<br>
test_expand_path_encoding(TestFileExhaustive):<br>
Encoding::InvalidByteSequenceError: "\xA4" on US-ASCII<br>
/home/chkbuild/build/ruby-1.9.3/20121025T112858Z/ruby/test/ruby/test_file_exhaustive.rb:433:in <code>encode' /home/chkbuild/build/ruby-1.9.3/20121025T112858Z/ruby/test/ruby/test_file_exhaustive.rb:433:in </code>test_expand_path_encoding'</li>
</ol>
<p>Since ruby_1_9_3 doesn't have encoding support of File.expand_path, I think skippping the test might be better.<br>
Encoding fix seems introduced at <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: File singleton methods (expand_path, realpath, dirname, basename, extname) should respect encodings (Closed)" href="https://redmine.ruby-lang.org/issues/5919">#5919</a> (r34372), but r34372 was not merged according to the list.<br>
<a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/45903" class="external">http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/45903</a></p>
<p>In my proposed backport patch skipping the test if non-windows platform.</p>
<p><a href="https://github.com/thecodeshop/ruby/blob/win-file-trunk/ruby_1_9_3/test/ruby/test_file_exhaustive.rb#L439" class="external">https://github.com/thecodeshop/ruby/blob/win-file-trunk/ruby_1_9_3/test/ruby/test_file_exhaustive.rb#L439</a></p> Backport193 - Backport #7174: Advocating for backporting 36811https://redmine.ruby-lang.org/issues/7174?journal_id=315882012-10-26T10:53:16Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul></ul><p>Hello,</p>
<p>In message "<a href="/issues/7174">[ruby-core:48282]</a> [Backport93 - Backport <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: Advocating for backporting 36811 (Closed)" href="https://redmine.ruby-lang.org/issues/7174">#7174</a>][Assigned] Advocating for backporting 36811"<br>
on Oct.25,2012 22:38:02, <a href="mailto:h.shirosaki@gmail.com" class="email">h.shirosaki@gmail.com</a> wrote:</p>
<blockquote>
<p>But I noticed the following failure occurs.</p>
<p><a href="http://u64.rubyci.org/~chkbuild/ruby-1.9.3/log/20121025T112858Z.log.html.gz" class="external">http://u64.rubyci.org/~chkbuild/ruby-1.9.3/log/20121025T112858Z.log.html.gz</a></p>
</blockquote>
<p>Thanks.</p>
<blockquote>
<p>Since ruby_1_9_3 doesn't have encoding support of File.expand_path, I think skippping the test might be better.<br>
Encoding fix seems introduced at <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: File singleton methods (expand_path, realpath, dirname, basename, extname) should respect encodings (Closed)" href="https://redmine.ruby-lang.org/issues/5919">#5919</a> (r34372), but r34372 was not merged according to the list.<br>
<a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/45903" class="external">http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/45903</a></p>
<p>In my proposed backport patch skipping the test if non-windows platform.</p>
<p><a href="https://github.com/thecodeshop/ruby/blob/win-file-trunk/ruby_1_9_3/test/ruby/test_file_exhaustive.rb#L439" class="external">https://github.com/thecodeshop/ruby/blob/win-file-trunk/ruby_1_9_3/test/ruby/test_file_exhaustive.rb#L439</a></p>
</blockquote>
<p>I'm planning to backport r34372.<br>
It was not rejected, but was only postponed because it's difficult.<br>
So, please wait a little.</p>
<a name="Regards"></a>
<h2 >Regards,<a href="#Regards" class="wiki-anchor">¶</a></h2>
<p>U.Nakamura <a href="mailto:usa@garbagecollect.jp" class="email">usa@garbagecollect.jp</a></p> Backport193 - Backport #7174: Advocating for backporting 36811https://redmine.ruby-lang.org/issues/7174?journal_id=326122012-11-08T14:07:16Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>already backported.</p>