chaincodelabs / libmultiprocess

C++ library and code generator making it easy to call functions and reference objects in different processes
MIT License
29 stars 20 forks source link

windows build failure #114

Open ryanofsky opened 2 months ago

ryanofsky commented 2 months ago

Prerequisite for adding windows support in #53 will be fixing windows build issues. Currently make -C depends HOST=x86_64-w64-mingw32 NO_QT=1 V=1 MULTIPROCESS=1 fails with:

bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/015e95f7ebaa47619a213a19801e7fffafc56864-9af0c516d6d/src/mp/util.cpp:13:10: fatal error: sys/resource.h: No such file or directory
   13 | #include <sys/resource.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
ryanofsky commented 2 months ago

This comment is just my notes about how to make make -C depends HOST=x86_64-w64-mingw32 work in nix-shell. A complete shell.nix file that works is https://gist.github.com/ryanofsky/d0a9ff32adb5b58f48a2ba771a2a9d74.

I use nixos for development, and the main thing that's been keeping me from implementing IPC support for windows has been build system issues. I didn't want to deal with inconvenience of implementing windows support in a non-nix container, and I never got a cross compiled mingw depends build working in nix-shell until now.

I needed the following changes to make this work:

I also made a number of mistakes along the way to getting this working: