Skip to content

Conversation

@MSP-Greg
Copy link

The gemspec for cgi was removed in Ruby head (3.5), and this is causing many problems. Unfortunately, many have been hidden.

Currently, https://github.com/ruby/ruby-dev-builder is failing, and has done so for 10 days, hence an older version is used in GHA CI. The failure is due to the command rdoc -v failing. See the 'CLI Test' step here.

The workflow hides the error, locally run:

/usr/local/lib/ruby/3.5.0+0/rubygems/specification.rb:1421:in 'block in Gem::Specification#activate_dependencies':
Could not find 'cgi' (>= 0.3.3) among 87 total gem(s) (Gem::MissingSpecError)

Also, a command line ruby -rerb -e "puts 'Success'" will fail.

@k0kubun
Copy link
Member

k0kubun commented May 11, 2025

gemspec can't actually have a conditional dependency because gemspec is evaulated when gem build is executed. When Ruby 3.4 builds this gem, it would always add cgi as a dependency. When Ruby 3.5 builds this gem, it would not add cgi as a dependency. So I can't merge this patch.

I understand that there's a cgi-related trouble in ruby-dev-builder, but this repository is not the right place to fix it. Given that cgi >= 0.3.3 definitely exists on rubygems.org, it's the fault of either rubygems or (the libdir of) CRuby. Please report it at an appropriate place.

@k0kubun k0kubun closed this May 11, 2025
@MSP-Greg
Copy link
Author

gemspec can't actually have a conditional dependency because gemspec is evaulated when gem build is executed. When Ruby 3.4 builds this gem, it would always add cgi as a dependency. When Ruby 3.5 builds this gem, it would not add cgi as a dependency.

Sorry. I thought that was the case, but I saw the code immediately above.

Thought about using Gem.install...

@k0kubun
Copy link
Member

k0kubun commented May 11, 2025

That's a valid code because we indeed run gem build once with CRuby and once with JRuby.

Screenshot 2025-05-11 at 14 02 25

However, we don't run gem build with different CRuby versions. What you're doing is different from it.

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