Building a debug version of the Ruby interpreter on Windows/MSYS2

Hi,

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:

compiling cont.c
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.

Thank you
Stephan

Hi Stephan,

Sorry to get your hope up by replying :slight_smile: but I do not have a direct answer!

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.

You might want to approach this group - https://groups.google.com/g/rubyinstaller which is for RubyInstaller and that's likely the best place for getting inputs about RubyInstaller, and Ruby on Windows.

Hope this helps a bit.

Best Regards,
Mohit.
2020-9-29 | 11:59 pm.

···

On 2020-9-29 6:53 pm, Stephan Mühlstrasser wrote:

Hi Mohit,

···

Am 29.09.20 um 17:59 schrieb Mohit Sindhwani:

You might want to approach this group - https://groups.google.com/g/rubyinstaller which is for RubyInstaller and that's likely the best place for getting inputs about RubyInstaller, and Ruby on Windows.

thank you, I will try asking in the RubyInstaller group then.

Best regards
Stephan