[MacRuby] #1128: MacRuby builds broken gems, probably since 1.4.2 update
#1128: MacRuby builds broken gems, probably since 1.4.2 update ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- I tried to `gem install` a gem today that I had built using `gem build` from the MacRuby gem command, but I get the following error: ERROR: While executing gem ... (Errno::ENOENT) No such file or directory - open() failed zsh: exit 1 If I try to run `gem install` using the gem command that comes with Ruby 1.9.2, then I get a different error: ERROR: While executing gem ... (ArgumentError) string contains null byte zsh: exit 1 BUT, when I run `gem build` using the Ruby 1.9.2 gem command then everything installs fine on both ruby implementations. I know that I was able to build gems using the MacRuby gem command in the past, so I am guessing that it broke during the 1.4.2 upgrade. -- Ticket URL: <http://www.macruby.org/trac/ticket/1128> MacRuby <http://macruby.org/>
#1128: MacRuby builds broken gems, probably since 1.4.2 update ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: 0.9-blocker ------------------------------------+--------------------------------------- Changes (by lsansonetti@…): * keywords: => 0.9-blocker * milestone: => MacRuby 1.0 Comment: Looks like a regression. Let's try to fix this in 0.9, adding 0.9-blocker keyword. -- Ticket URL: <http://www.macruby.org/trac/ticket/1128#comment:1> MacRuby <http://macruby.org/>
#1128: MacRuby builds broken gems, probably since 1.4.2 update ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: 0.9-blocker ------------------------------------+--------------------------------------- Comment(by watson1978@…): It seems that insert a unnecessary padding when create a Tar archive. Broken Tar archive can not extract. Workaround: {{{ #!diff diff --git a/lib/rubygems/package/tar_writer.rb b/lib/rubygems/package/tar_writer.rb index d115162..b825f26 100644 --- a/lib/rubygems/package/tar_writer.rb +++ b/lib/rubygems/package/tar_writer.rb @@ -146,7 +146,9 @@ class Gem::Package::TarWriter yield os if block_given? - min_padding = size - os.written + # FIXME : MacRuby inserts unnecessary padding + # min_padding = size - os.written + min_padding = 0 @io.write("\0" * min_padding) remainder = (512 - (size % 512)) % 512 }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1128#comment:2> MacRuby <http://macruby.org/>
#1128: MacRuby builds broken gems, probably since 1.4.2 update ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: 0.9-blocker ------------------------------------+--------------------------------------- Comment(by lsansonetti@…): Good investigation job! But I wonder if it's the right way to fix this problem. I wonder why min_padding isn't right here. -- Ticket URL: <http://www.macruby.org/trac/ticket/1128#comment:3> MacRuby <http://macruby.org/>
#1128: MacRuby builds broken gems, probably since 1.4.2 update ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: 0.9-blocker ------------------------------------+--------------------------------------- Comment(by watson1978@…): I attached test files. It seems to be caused this issue that the length of String which was read from file does not accord with the size of the file. -- Ticket URL: <http://www.macruby.org/trac/ticket/1128#comment:4> MacRuby <http://macruby.org/>
#1128: MacRuby builds broken gems, probably since 1.4.2 update ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: 0.9-blocker ------------------------------------+--------------------------------------- Comment(by watson1978@…): I wrote the string (which was read from file) to new file, new file is same size with original. So, I think that there is bug in String#size. {{{ $ cat test.rb File.open("file.txt", "rb") {|f| s = f.read p s.size File.open("tmp", "w") {|o| o.write s } } p File.stat("file.txt").size $ macruby test.rb 2975 2977 $ ls -l file.txt tmp -rw-r--r-- 1 watson staff 2977 2 8 16:11 file.txt -rw-r--r-- 1 watson staff 2977 2 8 16:42 tmp }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1128#comment:5> MacRuby <http://macruby.org/>
#1128: MacRuby builds broken gems, probably since 1.4.2 update ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: 0.9-blocker ------------------------------------+--------------------------------------- Comment(by lsansonetti@…): Good catch! I think it's because the string's encoding is UTF-8 and not binary. I think MacRuby will not use binary even if you pass "b" to File.open. -- Ticket URL: <http://www.macruby.org/trac/ticket/1128#comment:6> MacRuby <http://macruby.org/>
#1128: MacRuby builds broken gems, probably since 1.4.2 update ------------------------------------+--------------------------------------- Reporter: mrada@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.9 Component: MacRuby | Resolution: fixed Keywords: 0.9-blocker | ------------------------------------+--------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: MacRuby 1.0 => MacRuby 0.9 Comment: Should be fixed in r5224. (This is an interim fix until File.open honors the 'b' type). -- Ticket URL: <http://www.macruby.org/trac/ticket/1128#comment:7> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby