Feature #17845


Windows Ruby - ucrt build?

Added by MSP-Greg (Greg L) about 1 year ago. Updated 7 months ago.

Target version:


Currently, Windows Ruby is normally compiled two ways.

The first, mswin, is compiled using Microsoft's current Visual C compiler, and links to the universal runtime (ucrt).

The second, mingw, is compiled using MinGW gcc. This links to msvcrt, an older version of Microsoft's Visual C runtime.

Previously, all the MSYS2 MinGW packages linked to msvcrt. The MSYS2 project is now releasing build tools and packages linking to ucrt.

MSYS2 has provided ruby packages, and GitHub user @Biswa96 contributed, allowing Ruby to compile with ucrt.

I tried the patch with ruby-loco, and it builds. There are some test issues, haven't had a chance to look at them yet.

Normally, using exe/dll/so files together that use different versions of the runtime is not a good idea. Building extension gems with ucrt may provide gems that can be used with mswin, but can't be compiled due to issues with Visual C (vs gcc). Also, packages from the vcpkg project may be compatible with Ruby ucrt.

The reason for this post is that Windows Ruby built with ucrt is essentially another platform, but the build 'looks like' a mingw build.

This is really a third platform choice. What should it be called? Things like CONFIG['RUBY_SO_NAME'], RUBY_PLATFORM, etc?


ruby-mingw32-ucrt.patch (622 Bytes) ruby-mingw32-ucrt.patch xtkoba (Tee KOBAYASHI), 06/07/2021 02:15 PM
ruby-configure-mingw32-ucrt.patch (687 Bytes) ruby-configure-mingw32-ucrt.patch xtkoba (Tee KOBAYASHI), 06/09/2021 12:27 AM
ruby-configure-coroutine-mingw32.patch (351 Bytes) ruby-configure-coroutine-mingw32.patch xtkoba (Tee KOBAYASHI), 06/11/2021 01:27 AM
ruby-i386-mingw32-ucrt-undef.patch (398 Bytes) ruby-i386-mingw32-ucrt-undef.patch xtkoba (Tee KOBAYASHI), 06/13/2021 06:15 PM
ruby-date-mingw32-ucrt-timezone.patch (333 Bytes) ruby-date-mingw32-ucrt-timezone.patch xtkoba (Tee KOBAYASHI), 06/13/2021 06:22 PM

Also available in: Atom PDF