Skip the make jobserver on Windows#9630
Merged
Merged
Conversation
The POSIX make jobserver passes tokens through an inherited pipe identified by file descriptor numbers, which Windows cannot inherit, and nmake aborts every native extension build with `fatal error U1065: invalid option '-'` when it finds the GNU make `--jobserver-auth` left in MAKEFLAGS. Skip the jobserver entirely on Windows so bundle install keeps working with nmake. https://github.com/ruby/rbs/actions/runs/27736519019/job/82054372031 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The example exercises the genuine Windows code path, so tag it `windows_only` and exclude it elsewhere instead of stubbing `Gem.win_platform?`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The first version skipped the jobserver on every Windows platform, but mingw uses GNU make and consumes the jobserver tokens through the inherited pipe without trouble. Only nmake on mswin reads MAKEFLAGS as bare option letters and rejects the GNU make `--jobserver-auth`. Detect nmake the way the extension builder does and skip the jobserver only then, so mingw keeps building in parallel. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the make jobserver was introduced, bundle install fails on mswin for every gem with native extensions. The parallel installer adds a GNU make
--jobserver-authto MAKEFLAGS, which nmake inherits and reads as bare option letters. nmake then aborts each build withfatal error U1065: invalid option '-'. This broke ruby/rbs CI while installing bigdecimal, prism, digest, ffi and others.https://github.com/ruby/rbs/actions/runs/27736519019/job/82054372031
mingw and other Windows toolchains use GNU make and consume the jobserver tokens through the inherited pipe without trouble, so the skip is limited to nmake. The make program is detected the same way the extension builder picks it, honoring the MAKE environment variable and the mswin default.
The added spec forces nmake through the MAKE environment variable and checks that MAKEFLAGS is left untouched.