Guard: Signals trapping isn't working on Windows

Created on 6 May 2011  ·  3Comments  ·  Source: guard/guard

As discussed here and here

bug

Most helpful comment

LOL, here's a full list of supported signals and documented best practices for working around the rest. Have fun! ^_^;

All 3 comments

you mean to tell me that a specification for interoperability between unix derived operating systems isn't being adhered to by an operating system with a history almost entirely disconnected from unix? Yeah, no, that sounds about right. ;)

Posix Signals aren't generally available under windows as far as I know. There does exist an officially supported subsystem with a varied subset of POSIX APIs, but apparently only if you purchase the enterprise or ultimate versions of vista/win7. This includes the ability to write software that supports POSIX signals (but not automatic support of them). Hell, the enterprise windows unix... thing... even has an old and seemingly unmaintained port of debian that targets it. How's that for terrifying?

Anyways, jumping back to ruby. The initial port was done using cygwin. Cygwin's an absolutely massive POSIX and general UNIX compatibility layer that sacrifices performance, runtime size, and functionality as the cost of compatibility. It does, however, provide an absolute wealth of unix comfort in otherwise hostile territory. It wouldn't surprise me in the least if signal trapping worked just fine in windows as long as you made use of a cygwin-based ruby.

The original windows one-click installer made use of visual studio 6, which is dinosaur ancient. The current windows one-click installer makes use of mingw and msys. Neither would support posix signals but I don't know too much more than that. I took one look, saw a "gcc.bat" and "make.bat", and became very sad.

As an aside, ISO C99 does define a small number of non-posix signals that implementors are required to support, but the only two that are catchable via an exit handler are SIGINT and SIGTERM (at least according to spec, and we all know how much microsoft loves conforming to standards).

LOL, here's a full list of supported signals and documented best practices for working around the rest. Have fun! ^_^;

Thanks for your research, I think we'll need to found a workaround and skip Signals on windows :)

Was this page helpful?
0 / 5 - 0 ratings