Skip to content

Ruby 3.5 compatibility: add cgi gem, drop runtime rack‑test #954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 14, 2025

Conversation

numbata
Copy link
Contributor

@numbata numbata commented May 12, 2025

Ruby 3.5 retires the cgi library from the default gem set (ruby/ruby#13275), so we add it explicitly. Also the rack‑test gem is only used in specs, so it’s been dropped from the gemspec’s runtime deps; it remains in the dev/test Gemfile group.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Let's use this to fix up CHANGELOG?

Also maybe re-enable danger PR bot like in other grape projects ...

@numbata
Copy link
Contributor Author

numbata commented May 13, 2025

Also maybe re-enable danger PR bot like in other grape projects ...

Sure. I can do it in a follow up PR.

Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
@numbata
Copy link
Contributor Author

numbata commented May 13, 2025

As an option, we can close this PR and wait for the next Rack release that includes rack/rack#2327 (“Replace usage of CGI::Cookie; add Ruby 3.5 compatibility”).

Why it fails today (require chain)

spec/spec_helper.rb             → require 'rack/test'
rack-test/lib/rack/test.rb      → require 'rack/mock'
rack/lib/rack/mock.rb           → require_relative 'mock_request'
rack/lib/rack/mock_request.rb   → require_relative 'mock_response'
rack/lib/rack/mock_response.rb  → require 'cgi/cookie'   # removed in Ruby 3.5

The patch removes the offending require 'cgi/cookie' line, so the failure disappears once we bump Rack. Until that release is out, CI for all PR will stay 🔴.

@dblock dblock merged commit 1f7db6b into ruby-grape:master May 14, 2025
21 checks passed
@dblock
Copy link
Member

dblock commented May 14, 2025

I merged 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