Like many FOSS hacking stories, it all started on IRC. Somebody in #perl mentioned that they were having issues with working with ZeroMQ and an event loop. I mentioned that I had a module Net::Async::ZMQ that could help. Turns out that they had been reading the code for that but were trying to make it work with ZMQ::FFI instead of ZMQ::LibZMQ3 and ZMQ::LibZMQ4 which it was originally designed for.

So I added support for ZMQ::FFI. But for my CI build to pass, I needed Windows support and ZMQ::FFI did not support Windows yet.

I then did the next obvious thing which is patch ZMQ::FFI to work on Windows. In my first attempt, I found tests that were using fork(2), Sys::SigAction, and the ZeroMQ ipc:// transport (zmq_ipc(7)) which do not work on Windows, so I left those as is and just decided to have ZMQ::FFI look for .dll in addition to .so and .dylib files. That's not great; those tests should really pass before a release can be made.

As time went by, I went ahead and released Net-Async-ZMQ-0.002. No use in waiting for Windows to pass for ZMQ::FFI when it never did before.

Until one night I acquired a round tuit and went ahead and fixed all the ZMQ::FFI Windows compatibility issues. I also changed the ipc:// transport to inproc:// where possible, however, this changes the tests on Unix-likes. So I went with another attempt that refactored the tests based on OS capability. This and several CI build fixes got rolled into ZMQ-FFI-1.18.

While I was working on all this, I decided that I wanted to port Devel::IPerl to use ZMQ::FFI because it could be easier to install for users on Windows than ZMQ::LibZMQ3 which requires a compiler to link the XS with the ZeroMQ DLL. This is currently a pain point for Devel::IPerl that I work around by providing a script that sets up Alien::ZMQ::latest to install the ZeroMQ DLL and then points the ZMQ::LibZMQ3 install script to use that DLL for linking. Removing that script will make things less complicated overall.

Which is what I did in this PR. It did not take much, just replace functions such as zmq_init() with ZMQ::FFI->new and zmq_socket($zmq_ctx, $type) with $zmq_ctx->socket($type).

This is now available on CPAN as Devel-IPerl-0.012.

Appendix: List of issues and pull requests participated in along the way

Devel::IPerl

ZMQ::FFI

Alien::ZMQ::latest

Net::Async::ZMQ

microsoft/vcpkg

run-vcpkg GitHub Action

GitHub (the website itself)