Skip to content
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

Pin selenium-webdriver to fix a warning #2766

Merged
merged 4 commits into from
Jun 17, 2024
Merged

Pin selenium-webdriver to fix a warning #2766

merged 4 commits into from
Jun 17, 2024

Conversation

pirj
Copy link
Member

@pirj pirj commented Jun 17, 2024

Rails 7.1 is unaware of the new API and this crashes our CI, eg https://github.com/rspec/rspec-rails/actions/runs/9552072568/job/26328604445?pr=2765

pirj added 4 commits June 17, 2024 23:13

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Rails 7.1 is unaware of the new API and this crashes our CI

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
4.19 won’t work on Ruby 2.7
@pirj
Copy link
Member Author

pirj commented Jun 17, 2024

2.7 is broken with a uninitialized constant Gem apparently causing Puma not to get loaded.

@pirj
Copy link
Member Author

pirj commented Jun 17, 2024

Which is confusing, as it seems to load rack/handler/puma, but the Rack::Handler is not loaded. In Puma 5, that file was loading rack/handler and defined Rack::Handler::Puma, but in 6.x this happens only if Rackup is not loaded.
But the comment says that rackup was removed from rack 3, and evidently we install rack 3.

@pirj pirj merged commit cf4e72f into main Jun 17, 2024
14 of 17 checks passed
@pirj pirj deleted the fix-ci-warning branch June 17, 2024 19:33
@pirj
Copy link
Member Author

pirj commented Jun 17, 2024

I’ve merged this as it fixes Ruby 3.x builds with Rails 7.1.
Ruby 2.7 with Rails 7.1 runs into a different issue, which I hope to look into next.

@pirj
Copy link
Member Author

pirj commented Jun 18, 2024

In both cases, for 2.7 and for 3.x with Rails 7.1, we bundle puma 6.4.2 and also rackup 2.1.0. This means, Rack::Handler::Puma should not be defined. Unless there’s some race condition/load order dependency and we: 1) load rack/handler 2) load puma’s rack/handler/puma 3) (optionally) load rackup.
Where does the rackup dependency even come from?

@pirj
Copy link
Member Author

pirj commented Jun 18, 2024

The uninitialized constant Gem (NameError) can be caused by module Gem::Deprecate that was later changed into a nested declaration. But this change is 11 years old, why it’s not in rubygems 3.5.9 or 3.4.22 that are recent? 🤔
It appeared in 3.5.10 in this PR.
Apparently, the namespace definition was collapsed here more than a decade ago.
I hope this is just a warning with no consequences.

@pirj
Copy link
Member Author

pirj commented Jun 18, 2024

What’s interesting is that in another file there's similar code, but it suggests that rack > 3 must be used with rackup gem.
This whole problem seems due to rack::handler not being loaded when capybara registers its puma server, and puma registers itself as a rack handler.
Wondering, what makes a difference between 2.7 and 3.x?

JonRowe pushed a commit that referenced this pull request Jun 18, 2024
Pin selenium-webdriver to fix a warning
@JonRowe
Copy link
Member

JonRowe commented Jun 19, 2024

The problem is capybara fixed this in 3.40.0 but also pinned the base ruby version to 3.0

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.

None yet

2 participants