Use eventmachine from git master on Ruby >= 4.0 - #1464
Merged
Conversation
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>
3 tasks
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.
Summary
The
ruby: 'head'andruby: '4.0'CI jobs inbuild.ymlfail duringbundle installbecause eventmachine 1.2.7's bundledfastfilereaderC++ extension callsData_Wrap_Struct/Data_Get_Struct, both of which Ruby 4.0 removed from its headers: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
Gemfilenow pointseventmachineatgithub: 'eventmachine/eventmachine'(git master) whenRUBY_VERSION >= 4.0, falling back to the released 1.2.7 gem on older Rubies.spec/em/em_spec.rbalready tolerates eventmachine being unavailable via abegin/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
fastfilereaderext)bundle installresolveseventmachine (1.3.0.dev.1)from git master and compilesfastfilereaderext.bundle/rubyeventmachine.bundlecleanly under Ruby 4.0.6bundle exec rspec spec/em/em_spec.rb— 6 examples, 0 failuresbundle exec rspecsuite — 366 examples, 1 failure (pre-existing, unrelated fork/child-process flake), 7 pending (pre-existing SSL cert path skips)bundle exec rubocop— cleanRuby 4.0 and
ruby-headare already present in the CI matrix inbuild.yml, so no workflow changes are needed — the Gemfile's version check applies automatically to those jobs.🤖 Generated with Claude Code