ci: clear MAKEFLAGS so the mswin build's nmake works#3007
Conversation
The mswin (MSVC) job builds native gem extensions with `nmake`, which aborts with "NMAKE : fatal error U1065: invalid option '-'" when it inherits a GNU-make-style MAKEFLAGS from the environment. This broke `bundle install` (and would break `rake compile`) for the mswin matrix entry, while the mingw/UCRT GNU make builds tolerated the flag. Clear MAKEFLAGS for the compile job so nmake receives no flags. It is a harmless no-op for the GNU make builds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RENNXiMZ7ihuquCwKM4Ht
Temporarily print the raw MAKEFLAGS/MFLAGS values before clearing them in-script, to confirm what value the mswin nmake build was choking on. The in-script clear keeps the build green. This will be reverted to the clean job-level `env: MAKEFLAGS: ""` fix once the value is captured. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RENNXiMZ7ihuquCwKM4Ht
|
Closing — this turned out to be an upstream RubyGems bug that is already fixed, so the workaround here is unnecessary. Root cause: RubyGems' new make jobserver feature ( Already fixed upstream: current Verification: re-running the previously-failed Generated by Claude Code |
|
🙏 |
Problem
The
compile (mswin)job in Ruby on Windows has been failing onmastersince around Jun 16 (it passed on Jun 10). It dies duringbundle installwhile building native gem extensions (ffi,racc,zlib,strscan, …):Example run: https://github.com/ruby/rbs/actions/runs/27622377214/job/81674542835
Root cause
Only the mswin matrix entry fails;
ucrtand3.4pass. The difference is the make program: mswin uses MSVC'snmake, the others use GNUmake.The echoed command
nmake sitearchdir=... cleancontains no-, so the-that nmake rejects comes from an inheritedMAKEFLAGSenvironment variable. GNUmakeaccepts its own GNU-styleMAKEFLAGS;nmakeparses the leading-and aborts withU1065. This is the sameMAKEFLAGS+nmakeincompatibility documented in rust-lang/cargo#4156.ruby/setup-rubysetsMAKE=nmakefor mswin but does not exportMAKEFLAGS, so the value comes from the base environment and a workflow-levelenv:reliably overrides it. This is independent of any particular PR —masteritself is affected.Fix
Clear
MAKEFLAGSfor thecompilejob sonmakereceives no flags. It's a harmless no-op for the mingw/UCRT GNU make builds, and it also protects therake compilestep (which builds the RBS C extension vianmakeon mswin).🤖 Generated with Claude Code
https://claude.ai/code/session_014RENNXiMZ7ihuquCwKM4Ht
Generated by Claude Code