in reply to AnyEvent::Util::run_cmd on Windows

Hello Tanktalus,

do not expect more than a rubber duck debugging from me.. but maybe you can spot something interesting.

First i found a mention of the same issue and the author answers:

> It should work fine on windows, but probably places high demands on your fork implementation, so activestate perl might not work (and strawberry perl is probably as broken as always). Try a cygwin/sfu/uwin or so perl and see if it works better there.

After this i found that the last succesfull test with 5.24 on windows has the most part of tests skipped and a clear mention that it might works on cygwin.. bad sign

Also looking to the source of the run_cmd it uses other functions that are esplicitly deprecated for the win platform as portable_pipe

I played a little with your code and changed /my.out (you mean ./my.out perhaps?) into my.out but it hangs until i kill the program an so i found Terminating on signal SIGINT(2) into my.err file.

When I put $|++ at the top of the program and added a and die to my $rc = $cv->recv; i found the Started into the terminal as you noted for Linux platform.

Maybe this module is not the best choice for that platform.. I'm not an expert at all but have you considered using MCE that does a big effort to be usable and efficient on win32 platform too? or IPC::Run to get rid of STDOUT STDERR of an external program?

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: AnyEvent::Util::run_cmd on Windows
by Anonymous Monk on Oct 06, 2018 at 18:09 UTC
    As a sidenote, portable_pipe is of course not deprecated, but recommended for the windows platform (it explicitly says so in both documentation and source), as perl's pipe builtin is broken in most windows perls.