Bundler attempts to install gems specified with `platforms: :mri` on TruffleRuby (and maybe jruby too)
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 4k
- Forks
- 1.9k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 81
Description
Describe the problem as clearly as you can
Gemfile has:
gem 'fiber_scheduler', platforms: :mri
On TruffleRuby (RUBY_VERSION 3.0.3), bundler 2.4.6 attempts to install fiber_scheduler gem. Ultimately this fails, as fiber_scheduler requires RUBY_VERSION >= 3.1.0
However, bundler should not even attempt to install a gem specified with platforms: :mri on TruffleRuby. Per https://bundler.io/v2.4/man/gemfile.5.html#PLATFORMS
See here: https://github.com/rickhull/miner_mover/actions/runs/4067260405/jobs/7004396321#step:6:9
Run bundle install
bundle install
shell: /usr/bin/bash -e {0}
Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
Could not find compatible versions
Because every version of fiber_scheduler depends on Ruby >= 3.1.0
and Gemfile depends on fiber_scheduler >= 0,
Ruby >= 3.1.0 is required.
So, because current Ruby version is = 3.0.3,
version solving has failed.
Error: Process completed with exit code 6.
Did you try upgrading rubygems & bundler?
Yes. See here: https://github.com/rickhull/miner_mover/actions/runs/4067260405/jobs/7004396321#step:5:10
Post steps to reproduce the problem
Create Gemfile:
source 'https://rubygems.org/'
gem 'fiber_scheduler', platforms: :mri
On TruffleRuby 3.0.3, after updating RubyGems and Bundler, run: bundle install
Which command did you run?
bundle install
What were you expecting to happen?
gem install fiber_scheduler should not be attempted
What actually happened?
bundler attempted to install fiber_scheduler gem on TruffleRuby
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown Gemfile on TruffleRuby 3.0.3 by running bundle install after updating RubyGems and Bundler. Trace Bundler's handling of the platforms: :mri declaration and verify that fiber_scheduler is not attempted on TruffleRuby, while the command continues to resolve correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100