Skip to content

fix(ci): Ruby build-from-source fails on Windows with newer MinGW/GCC toolchains #231

@CalvinAllen

Description

@CalvinAllen

Problem

The build-ruby-from-source workflow fails when compiling older Ruby versions (e.g., 3.2.10) on Windows using MSYS2/MinGW. The newer GCC 15.x toolchain in MSYS2 produces incompatible pointer type errors in Ruby's atomic operations headers:

./include/ruby/atomic.h:223:33: error: passing argument 1 of 'rbimpl_atomic_size_exchange' from incompatible pointer type [-Wincompatible-pointer-types]
./include/ruby/atomic.h:237:28: error: passing argument 1 of 'rbimpl_atomic_size_cas' from incompatible pointer type [-Wincompatible-pointer-types]
make: *** [Makefile:468: random.o] Error 1

Context

  • The workflow uses fail-fast: false so Unix builds still succeed — this is non-blocking for the primary use case (filling Linux/macOS gaps)
  • Windows builds from RubyInstaller are already mirrored via mirror-sync, so the build-from-source Windows path is only needed when RubyInstaller hasn't published a build yet
  • There's no known mapping of Ruby version → compatible MinGW/GCC toolchain version
  • Pinning a specific toolchain version per Ruby version would be fragile and hard to maintain

Possible approaches

  • Pin an older MinGW toolchain version in MSYS2 (need to determine which version per Ruby release)
  • Apply source patches to Ruby before building (e.g., fix atomic.h for newer GCC)
  • Use RubyInstaller2's build recipes which already handle toolchain compatibility
  • Skip Windows in build-from-source entirely since RubyInstaller covers it
  • Accept failures as non-blocking (current behavior)

References

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions