FS#29492 - [gvim] ruby 'system' function broken

Attached to Project: Arch Linux
Opened by John S. Smith (potatoe) - Monday, 16 April 2012, 18:14 GMT
Last edited by Thomas Dziedzic (tomd123) - Sunday, 13 May 2012, 21:08 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Thomas Dziedzic (tomd123)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
In gvim, trying to use the built-in ruby's "system" call always results in a NoMethodError error being thrown. For example,
:ruby system('echo')
OR
:ruby `echo`
causes a "NoMethodError: undefined method `flush` for #<Object:0x00000002857918>" error.

Vimux is an example of a vim plugin which the broken ruby system function prevents from working (https://github.com/benmills/vimux/issues/14).

I don't know if this is a bug in the packaging, or an upstream bug with vim and ruby 1.9 on linux (the vimux ticket mentions a hand-compiled vim + ruby 1.9 on ubuntu exhibiting the same problem, and a recompiled vim on arch targeting ruby 1.8 fixing it), however on a windows machine with the stock pre-compiled gvim 7.3.46 (from vim.org) and ruby 1.9.3p125 (from rubyinstaller.org), the system function works without error.

This error was previously reported in 2010 as  FS#19991 , but I don't know if it was fixed and has now broken again, or maybe the other ruby bug it was marked as a duplicate of ( FS#19954 ) ended up having a different root cause and the system function has always been broken on Arch packages.

Additional info:
My systems are all x86_64, I don't know if the problem exists on i686. Might be worth checking, since the working windows version is a 32-bit binary.
* package version(s)
gvim 7.3.495-1
ruby 1.9.3_p125-4
* config and/or log files etc.
Error exists with default config (no user .vimrc/.vim directory)

Steps to reproduce:
:ruby system('echo')

Error is "NoMethodError: undefined method `flush' for #<Object:0x000000017abbc8>" (Note: Object's id will differ from run to run)
This task depends upon

Closed by  Thomas Dziedzic (tomd123)
Sunday, 13 May 2012, 21:08 GMT
Reason for closing:  Fixed
Additional comments about closing:  bump to vim 7.3.515-1 fixes this bug
Comment by Thomas Dziedzic (tomd123) - Monday, 16 April 2012, 18:20 GMT Comment by John S. Smith (potatoe) - Monday, 16 April 2012, 19:21 GMT
Oops, definitely upstream then. Sorry for jumping the gun on filing this.

(and presumably it works on Windows because rubyinstaller seems to ship their DLL as a 1.9.1 API even with ruby 1.9.3, probably to continue working with precompiled packages like vim)
Comment by Thomas Dziedzic (tomd123) - Monday, 16 April 2012, 19:25 GMT
np, the bug will remain open and I'll release a new vim version as soon as I see that it is fixed upstream to close this bug :)

1.9.1 is used as the api version, which is different from the ruby version.
Even arch's packages have a 1.9.1 folder for ruby.
Comment by Felipe Contreras (felipec) - Saturday, 21 April 2012, 21:13 GMT
That patch looks like a workaround, the correct fix would be to remove the calls to 'flush'.

Anyway, if you want to workaround the issue in your script, you can do:

class Object
def flush
end
end

It's effectively the same.
Comment by Thomas Dziedzic (tomd123) - Saturday, 21 April 2012, 23:47 GMT
Felipe, can you comment on that report upstream?
Comment by Thomas Dziedzic (tomd123) - Saturday, 28 April 2012, 16:45 GMT
This has been fixed in http://code.google.com/p/vim/source/detail?r=d7b335626ddc7a61667cb3e23ecadfe399b676fb
The next vim rebuild will fix this.

Loading...