Skip to content

Restore rb_sys dependency for Rust#9416

Open
bangseongbeom wants to merge 2 commits intoruby:masterfrom
bangseongbeom:restore-rb-sys
Open

Restore rb_sys dependency for Rust#9416
bangseongbeom wants to merge 2 commits intoruby:masterfrom
bangseongbeom:restore-rb-sys

Conversation

@bangseongbeom
Copy link

@bangseongbeom bangseongbeom commented Mar 20, 2026

What was the end-user or developer problem that led to this PR?

After running bundle gem --ext=rust my_gem and bundle install, I got an error when I run bundle exec rake compile (I followed oxidize.rb guide):

$ bundle exec rake compile
rake aborted!
LoadError: cannot load such file -- rb_sys/extensiontask (LoadError)
/.../Rakefile:12:in '<top (required)>'
/.../rake:27:in '<top (required)>'
(See full trace by running task with --trace)

What is your fix for the problem, implemented in this PR?

Revert #8455 partially. In that PR, rb_sys was removed from the dependencies, but it seems to be unintended. Without rb_sys, rb_sys/extensiontask cannot be loaded, so all rake commands cannot be run.

Make sure the following tasks are checked

Copilot AI review requested due to automatic review settings March 20, 2026 17:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores the rb_sys gem dependency in Bundler’s Rust gem scaffolding so the generated Rakefile (which requires rb_sys/extensiontask) works after bundle install, fixing LoadError failures when running tasks like bundle exec rake compile.

Changes:

  • Add rb_sys as a dependency in the Rust newgem gemspec template.
  • Update bundle gem --ext=rust specs to assert the generated gemspec includes rb_sys.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
bundler/spec/commands/newgem_spec.rb Updates Rust scaffold expectations to include an rb_sys dependency in the generated gemspec.
bundler/lib/bundler/templates/newgem/newgem.gemspec.tt Adds rb_sys dependency when generating a gem with --ext=rust.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants