I need to debug a problem with a Ruby gem that wraps a C library. I'm fairly new to Ruby, so please forgive me if I'm asking some obvious questions. I tried to find answers on https://www.ruby-lang.org/ and in the Ruby GitHub repository, but without success.
How can I build Ruby on Windows with MSYS2 so that I can modify and debug the interpreter? I read the instructions in the Ruby GitHub repository about building Ruby, and I tried the build using autoconf, configure and make, and this fails with the following error:
In file included from cont.c:19:
coroutine/ucontext/Context.h:12:10: fatal error: ucontext.h: No such file or directory
12 | #include <ucontext.h>
This happens in a bash shell started from the MSYS2 environment that came with Ruby 2.7.1.
I then made an attempt to build Ruby with rubyinstaller2 from https://github.com/oneclick/rubyinstaller2. This apparently does work because it produces an installable package, but it is unclear how I could use this build system to get a debuggable Ruby installation where I also can make modification to the sources.
The background is that I need to analyze a problem with a gem that embeds a C library and also curl for HTTP transfers. We wrap this C library including curl for several programming languages, and only in the context of Ruby on Windows there is a problem with network transfers via curl. So the current hypothesis is that there is some interaction between the Ruby interpreter and the embedded curl library that causes these problems.