Skip to content

Use eventmachine from git master on Ruby >= 4.0 - #1464

Merged
sodabrew merged 2 commits into
brianmario:masterfrom
sodabrew:fix-eventmachine-ruby-head
Aug 7, 2026
Merged

Use eventmachine from git master on Ruby >= 4.0#1464
sodabrew merged 2 commits into
brianmario:masterfrom
sodabrew:fix-eventmachine-ruby-head

Conversation

@sodabrew

@sodabrew sodabrew commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

The ruby: 'head' and ruby: '4.0' CI jobs in build.yml fail during bundle install because eventmachine 1.2.7's bundled fastfilereader C++ extension calls Data_Wrap_Struct/Data_Get_Struct, both of which Ruby 4.0 removed from its headers:

rubymain.cpp:53:19: error: 'Data_Wrap_Struct' was not declared in this scope

eventmachine has had no release since 1.2.7 (2019), but its maintainer confirmed this is already fixed on master (eventmachine/eventmachine@79f05e4) — just not yet cut into a release.

Fix

Gemfile now points eventmachine at github: 'eventmachine/eventmachine' (git master) when RUBY_VERSION >= 4.0, falling back to the released 1.2.7 gem on older Rubies. spec/em/em_spec.rb already tolerates eventmachine being unavailable via a begin/rescue LoadError, so no spec changes were needed.

This is a stopgap: once eventmachine cuts a release containing the fix, the version constraint here should be updated to require that release instead of pinning to git master.

Test plan

  • Installed Ruby 4.0.6 locally via mise, confirmed the CI failure reproduces with the Gemfile unchanged (eventmachine 1.2.7 fails to compile fastfilereaderext)
  • With this fix, bundle install resolves eventmachine (1.3.0.dev.1) from git master and compiles fastfilereaderext.bundle/rubyeventmachine.bundle cleanly under Ruby 4.0.6
  • bundle exec rspec spec/em/em_spec.rb — 6 examples, 0 failures
  • Full bundle exec rspec suite — 366 examples, 1 failure (pre-existing, unrelated fork/child-process flake), 7 pending (pre-existing SSL cert path skips)
  • bundle exec rubocop — clean

Ruby 4.0 and ruby-head are already present in the CI matrix in build.yml, so no workflow changes are needed — the Gemfile's version check applies automatically to those jobs.

🤖 Generated with Claude Code

sodabrew and others added 2 commits August 7, 2026 13:38
eventmachine 1.2.7's bundled fastfilereader C++ extension uses
Data_Wrap_Struct/Data_Get_Struct, which Ruby 4.0 removed from its
headers, breaking `bundle install` on ruby-head and 4.0 CI jobs.

eventmachine's maintainer confirmed this is fixed on master
(eventmachine/eventmachine@79f05e4) but not yet released, so track
git master for Ruby >= 4.0 until a new release ships.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sodabrew
sodabrew merged commit 48c28f4 into brianmario:master Aug 7, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant