{"id":21871678,"url":"https://github.com/paradoxv5/ruby-mingw-make","last_synced_at":"2026-01-08T14:09:55.692Z","repository":{"id":221776958,"uuid":"749201928","full_name":"ParadoxV5/ruby-mingw-make","owner":"ParadoxV5","description":"Patches that enable Windows Ruby to install C extension gems with MinGW without MSYS2 (Devkit)","archived":false,"fork":false,"pushed_at":"2024-06-04T03:34:07.000Z","size":42,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T11:42:07.458Z","etag":null,"topics":["mingw","mingw-w64","ruby-windows"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/mingw-make","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ParadoxV5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ParadoxV5"}},"created_at":"2024-01-27T21:35:46.000Z","updated_at":"2024-06-29T23:57:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"ace427e4-146e-40ba-9867-f221a73c6241","html_url":"https://github.com/ParadoxV5/ruby-mingw-make","commit_stats":null,"previous_names":["paradoxv5/ruby-mingw-make"],"tags_count":3,"template":false,"template_full_name":"ParadoxV5/template-ruby-gem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParadoxV5%2Fruby-mingw-make","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParadoxV5%2Fruby-mingw-make/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParadoxV5%2Fruby-mingw-make/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ParadoxV5%2Fruby-mingw-make/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ParadoxV5","download_url":"https://codeload.github.com/ParadoxV5/ruby-mingw-make/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246307932,"owners_count":20756478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mingw","mingw-w64","ruby-windows"],"created_at":"2024-11-28T06:14:56.678Z","updated_at":"2026-01-08T14:09:55.633Z","avatar_url":"https://github.com/ParadoxV5.png","language":"Ruby","funding_links":["https://github.com/sponsors/ParadoxV5"],"categories":[],"sub_categories":[],"readme":"When it comes to C-based extension Ruby gems on Windows,\nthe status quo depends on the heavyweight [MSYS2](https://www.msys2.org) to build and install them.\nHowever, [__Minimum__ GNU for Windows (MinGW)](https://github.com/niXman/mingw-builds-binaries/releases),\na key component of MSYS2, is sufficient for half of the jobs all on its own.\n\n`mingw-make` is a set of tiny non-intrusive mods for [RubyInstaller2 for Windows](https://rubyinstaller.org)\nthat solves the hurdles on the other half minimally, namely by replacing `rbconfig` entries of compilation commands.\nWith the aid of the secret [`ruby -run`](https://github.com/ruby/un) capability it has unleashed,\nall it took was a couple of quick hacks and we have ourselves a lightweight Devkit.\n\nSetups with MinGW and RubyInstaller’s prebuilds with these patches are ideal to keep footprints small,\nthough experts strongly recommend WSL for a fully-fledged Ruby environment.\n\n### Compatibility\n\nI’m glad to announce that, except for Prism for which I have sent PRs,\n**this experiment works with `gem update` versions of every [Default and Bundled C extension](https://stdgems.org) 📈**.\n\nWhile I have only tested this experiment with the following projects,\nIn theory, it’s compatible with anything that doesn’t leave\n[`rbconfig`](https://rubyapi.org/o/RbConfig)+[`mkmf`](https://rubyapi.org/o/MakeMakefile)’s comfort zone,\nwhich I expect to be the majority of C-based gems. (It *will indeed* “take a while” when “Building native extensions”.)\nPlease do [let me know](https://github.com/ParadoxV5/ruby-mingw-make/issues)\nif it doesn’t meet the expectations on something not unusual.\n\n#### builds\n\n* __`railties 7.1.3`__\n  * `bigdecimal 3.1.6..3.1.8`\n  * `io-console 0.7.2`\n  * `racc 1.7.3..1.8.0`\n* __`steep 1.6.0`__\n  * `json 2.7.2`\n  * `debug 1.9.2`\n  * `rbs 3.4.4`\n  * `strscan 3.1.0`\n* `nkf 0.2.0`\n* [`prism 9bb8710`](https://github.com/ruby/prism/pull/2711)\n\n#### fails\n* `prism ..0.29.0`:\n  \u003e * It must be possible to build prism without needing ruby/rake/etc.\n  \u003e   Because once prism is the single parser in TruffleRuby, JRuby or CRuby there won't be another Ruby parser around to parse such Ruby code.\n  \u003e   \\[…]\n  \u003e \n  \u003e The main solution for the second point seems a Makefile, otherwise many of the usages would have to duplicate the logic to build prism.\n  \u003e \n  \u003e ⸺ https://github.com/ruby/prism/blob/19c67fb/docs/build_system.md#requirements\n* `ffi ...1.17` (Prebuilt gems are available est. [1.17.0](https://rubygems.org/gems/ffi/versions/1.17.0).rc.)\n\n### not thoroughly tested\n* `syslog 0.1.2`: [It’s UNIX-specific.](https://stackoverflow.com/a/9503254)\n* `readline-ext 0.2.0`: ``extconf.rb:64:in `\u003cmain\u003e': Neither readline nor libedit was found (RuntimeError)``\n\n\n## Setup\n\n### Requirements\n* Windows\n  * Linux need MinGW not.\n* Ruby from RubyInstaller2 without DevKit (MSYS2)\n  * Does it work with other Rubies? Well… maybe?\n* MinGW for the Universal C Runtime (UCRT), with the `bin`aries folder on the `PATH`\n  * Will it work with MSYS? Uhh… likely not.\n\n### Installation\n```sh\ngem install mingw-make\n```\n\n### Use with `gem`\n\nThanks to `gem`’s [plugins](https://guides.rubygems.org/plugins/) system, it’s online out of the box!\n\n### Use with [`rake-compiler`](https://github.com/rake-compiler/rake-compiler)\n\nSlap this somewhere in the `Rakefile`:\n```ruby\nbegin\n  require 'mingw-make'\nrescue LoadError\n  # ignore\nend\n```\n\n### Use manually\n*Prepend* (so it takes precedence) the [`lib/mingw-make/mkmf.rb`](lib/mingw-make/mkmf.rb)\nscript to the Ruby `$LOAD_PATH`. Because RubyGems `require 'rbconfig'`,\nwe must explicitly apply [the `rbconfig` replacements](lib/mingw-make/rbconfig-patch.rb).\n```bat\nset RUBYOPT=-Ipath/to/gems/mingw-make/lib/mingw-make/ -rrbconfig-patch\n```\nYou may also need to specify a fallback for the `MAKE` tool, e.g.:\n```bat\nset MAKE=mingw32-make\n```\n\n\n## How to Contribute\n\nAckchyually – I would much prefer you **don’t**, but instead forward my tinkering to their corresponding upstreams.\nWindows users like me would love if our chérie lang doesn’t require more (WSL) or less (MSYS) a Linux Virtual Machine.\n(Imagine… Ruby VM in a Linux VM in a Windows VM… 🫠)\nAfter all, the [WTFPL](LICENSE.txt) means that I’ve decided to release my knowledge to the public domain,\nso no need to thank me and go bring developer happiness to its next level!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparadoxv5%2Fruby-mingw-make","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparadoxv5%2Fruby-mingw-make","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparadoxv5%2Fruby-mingw-make/lists"}