treasure-data / serverengine

A framework to implement robust multiprocess servers like Unicorn
Apache License 2.0
759 stars 86 forks source link

Not work on ruby 3.1 x64-mingw-ucrt #114

Closed kubo closed 2 years ago

kubo commented 2 years ago

A bug report was filed at the ruby issue tracker. I think that it is an issue of this repository. https://bugs.ruby-lang.org/issues/18472

The following code tries to load the ruby dll in the ruby bin directory. However it doesn't work on ruby 3.1 x64 distributed by rubyinstaller.org. That's because the dll name is x64-ucrt-ruby310.dll and doesn't match *msvcr*ruby*.dll. https://github.com/treasure-data/serverengine/blob/4d6dbd3d1b4e1af88cc2593b5b19cf0f6da7d5dd/lib/serverengine/winsock.rb#L104-L110

I think that it will be fixed by the following code:

    require 'rbconfig'
    dlload RbConfig::CONFIG['LIBRUBY_SO']

Well, I checked that a small script including the above code and extern "int rb_w32_map_errno(int)" worked fine but I have not tested it inside of serverengine. I'm not a user of serverengine.

ashie commented 2 years ago

Thanks for your report! I'll check it.