From: "hsbt (Hiroshi SHIBATA) via ruby-core" Date: 2026-10-06T10:57:09+00:00 Subject: [ruby-core:126936] [Ruby Feature#22408] Use GNU make instead of nmake for mswin builds Issue #22408 has been reported by hsbt (Hiroshi SHIBATA). ---------------------------------------- Feature #22408: Use GNU make instead of nmake for mswin builds https://bugs.ruby-lang.org/issues/22408 * Author: hsbt (Hiroshi SHIBATA) * Status: Open ---------------------------------------- The mswin build uses nmake, whose dialect is restrictive. It cannot run jobs in parallel, has no VPATH, and its substitution `$(VAR:a=b)` cannot contain macros. nmake 14.30 (VS 2022) added functions such as `$(subst)` that can, but we cannot use them while the VS 2017 and 2019 toolsets, which come with older nmake, are supported. Keeping `common.mk` and `win32/Makefile.sub` working with it depends on nobu alone, and nobu has said he would like to drop nmake if he could. I have no preference between nmake and GNU make, because I can keep either one working with a coding agent. But `-j` with GNU make would speed up the build, which is very attractive. https://github.com/ruby/ruby/pull/19214 adds `win32/GNUmakefile.sub`, and `make exam` passes with it. These are the times to build Ruby after `configure.bat`, from one run each. | | nmake | GNU make | |---|---|---| | My machine, 16 jobs | 565 s | 131 s | | GitHub Actions `windows-2025-vs2026`, 4 jobs | 616 s | 343 s | `make check` took about the same time as `nmake check` on GitHub Actions (602 s and 550 s), because the tests already run in parallel. Switching does not reduce the Windows specific makefiles, since `GNUmakefile.sub` only takes the place of `Makefile.sub`. GNU make has no official Windows binary. `win32/install-gnumake.cmd` downloads the GNU release, checks its SHA256, and builds `make.exe` with cl.exe in about 15 seconds. `configure.bat` itself still runs nmake. ``` win32\install-gnumake.cmd set PATH=%CD%\.gnumake;%PATH% win32\configure.bat ruby win32\mkgnumakefile.rb make -j16 ``` A Ruby built this way records `--with-make-prog=make` in `RbConfig::CONFIG["configure_args"]`, so `gem install` runs `make` for C extensions. The release package will ship the same script, and `make install` will put the `make.exe` next to `ruby.exe` so that `gem install` finds it. I am unsure whether to keep nmake alongside GNU make or to replace it right away. I would like to hear opinions. My proposal is to support both in Ruby 4.1 and, if nothing goes wrong, to make GNU make the only option in Ruby 4.2. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/