ahoward / systemu

univeral capture of stdout and stderr and handling of child process pid for windows, *nix, etc.
Other
126 stars 33 forks source link

systemu ~> 2.4.0 broken on Windows Ruby 1.9? #14

Closed purp closed 9 years ago

purp commented 12 years ago

As reported in http://tickets.opscode.com/browse/OHAI-306 there's seemingly an issue with running systemu 2.4.x on Windows Ruby 1.9.x:

C:\Ruby192\bin>irb
irb(main):001:0> require 'systemu'
=> true
irb(main):002:0> systemu('ruby --version')
RuntimeError: wtf?
o:↕ArgumentError:       mesg"∟dump format error(0x67):bt[I"rC:/Users/ADMINI~1/Ap
pData/Local/Temp/2/systemu_ip-0ADC899B_2824_1916_0.8916156963740122_1/program:3:
in `load'♠:
encoding"♂IBM437I"tC:/Users/ADMINI~1/AppData/Local/Temp/2/systemu_ip-0ADC899B_28
24_1916_0.8916156963740122_1/program:3:in `<main>'♠@

        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:88
:in `rescue in block (3 levels) in systemu'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:81
:in `block (3 levels) in systemu'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:75
:in `popen'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:75
:in `block (2 levels) in systemu'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:16
7:in `quietly'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:74
:in `block in systemu'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:23
3:in `call'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:23
3:in `block in tmpdir'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:21
8:in `loop'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:21
8:in `tmpdir'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:67
:in `systemu'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/systemu-2.4.0/lib/systemu.rb:9:
in `systemu'
        from (irb):2
        from C:/Ruby192/bin/irb:12:in `<main>'
damphyr commented 12 years ago

This is an issue with the use of YAML (before the syck fix) and Marshal on Windows. Using inspect works. I made a patch that adds a parameter that allows you to chose a serialization strategy, see https://github.com/ahoward/systemu/pull/8

damphyr commented 9 years ago

Fixed by #39