-
Notifications
You must be signed in to change notification settings - Fork 47
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
Provide URI::RFC2396_PARSER
for Ruby 3.3 or older
#118
Comments
This pull request allows `URI::RFC3986_PARSER` warnings appered since https://buildkite.com/rails/rails-nightly/builds/931 This warning has been implemented to Ruby master branch via ruby/ruby@b41d799 and the original pull request for URI is ruby/uri#114 We are not able to just replace `URI::DEFAULT_PARSER` with `URI::RFC2396_PARSER` because `URI::RFC2396_PARSER` gets `uninitialized constant URI::RFC2396_PARSER (NameError)` with Ruby 3.3.4 as reported ruby/uri#118 We can revert this commit and replace `URI::DEFAULT_PARSER` with `URI::RFC2396_PARSER` once `URI::RFC2396_PARSER` is available for uri bundled with Ruby 3.3.4 or older versions. - This commit allows the warning below and let Rails CI against Ruby master branch run ``` $ RAILS_STRICT_WARNINGS=1 bin/test test/abstract/callbacks_test.rb /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2063: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly. /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/testing/strict_warnings.rb:35:in 'ActiveSupport::RaiseWarnings#warn': /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2063: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly. (ActiveSupport::RaiseWarnings::WarningError) from <internal:warning>:54:in 'Kernel#warn' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/uri/rfc3986_parser.rb:156:in 'URI::RFC3986_Parser#escape' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2063:in 'ActionDispatch::Routing::Mapper::Resources#add_route' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2038:in 'ActionDispatch::Routing::Mapper::Resources#decomposed_match' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2002:in 'block in ActionDispatch::Routing::Mapper::Resources#map_match' from <internal:array>:53:in 'Array#each' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:1996:in 'ActionDispatch::Routing::Mapper::Resources#map_match' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:1739:in 'ActionDispatch::Routing::Mapper::Resources#match' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:798:in 'ActionDispatch::Routing::Mapper::HttpHelpers#map_method' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:741:in 'ActionDispatch::Routing::Mapper::HttpHelpers#get' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract_unit.rb:71:in 'block (2 levels) in <top (required)>' from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/deprecation/reporting.rb:43:in 'ActiveSupport::Deprecation::Reporting#silence' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract_unit.rb:70:in 'block in <top (required)>' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:479:in 'BasicObject#instance_exec' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:479:in 'ActionDispatch::Routing::RouteSet#eval_block' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:461:in 'ActionDispatch::Routing::RouteSet#draw' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract_unit.rb:69:in '<top (required)>' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'Kernel.require' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'block (2 levels) in Kernel#replace_require' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract/callbacks_test.rb:3:in '<top (required)>' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'Kernel.require' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'block (2 levels) in Kernel#replace_require' from /home/yahonda/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:62:in 'block in Rails::TestUnit::Runner.load_tests' from <internal:array>:53:in 'Array#each' from /home/yahonda/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:60:in 'Rails::TestUnit::Runner.load_tests' from /home/yahonda/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:52:in 'Rails::TestUnit::Runner.run' from /home/yahonda/src/github.com/rails/rails/tools/test.rb:18:in '<top (required)>' from bin/test:5:in 'Kernel#require_relative' from bin/test:5:in '<main>' $ ```
This pull request allows `URI::RFC3986_PARSER` warnings appeared since https://buildkite.com/rails/rails-nightly/builds/931 This warning has been implemented to Ruby master branch via ruby/ruby@b41d799 and the original pull request for URI is ruby/uri#114 We are not able to just replace `URI::DEFAULT_PARSER` with `URI::RFC2396_PARSER` because `URI::RFC2396_PARSER` gets `uninitialized constant URI::RFC2396_PARSER (NameError)` with Ruby 3.3.4 as reported ruby/uri#118 We can revert this commit and replace `URI::DEFAULT_PARSER` with `URI::RFC2396_PARSER` once `URI::RFC2396_PARSER` is available for uri bundled with Ruby 3.3.4 or older versions. - This commit allows the warning below and let Rails CI against Ruby master branch run ``` $ RAILS_STRICT_WARNINGS=1 bin/test test/abstract/callbacks_test.rb /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2063: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly. /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/testing/strict_warnings.rb:35:in 'ActiveSupport::RaiseWarnings#warn': /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2063: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly. (ActiveSupport::RaiseWarnings::WarningError) from <internal:warning>:54:in 'Kernel#warn' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/uri/rfc3986_parser.rb:156:in 'URI::RFC3986_Parser#escape' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2063:in 'ActionDispatch::Routing::Mapper::Resources#add_route' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2038:in 'ActionDispatch::Routing::Mapper::Resources#decomposed_match' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2002:in 'block in ActionDispatch::Routing::Mapper::Resources#map_match' from <internal:array>:53:in 'Array#each' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:1996:in 'ActionDispatch::Routing::Mapper::Resources#map_match' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:1739:in 'ActionDispatch::Routing::Mapper::Resources#match' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:798:in 'ActionDispatch::Routing::Mapper::HttpHelpers#map_method' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:741:in 'ActionDispatch::Routing::Mapper::HttpHelpers#get' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract_unit.rb:71:in 'block (2 levels) in <top (required)>' from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/deprecation/reporting.rb:43:in 'ActiveSupport::Deprecation::Reporting#silence' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract_unit.rb:70:in 'block in <top (required)>' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:479:in 'BasicObject#instance_exec' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:479:in 'ActionDispatch::Routing::RouteSet#eval_block' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:461:in 'ActionDispatch::Routing::RouteSet#draw' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract_unit.rb:69:in '<top (required)>' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'Kernel.require' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'block (2 levels) in Kernel#replace_require' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract/callbacks_test.rb:3:in '<top (required)>' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'Kernel.require' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'block (2 levels) in Kernel#replace_require' from /home/yahonda/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:62:in 'block in Rails::TestUnit::Runner.load_tests' from <internal:array>:53:in 'Array#each' from /home/yahonda/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:60:in 'Rails::TestUnit::Runner.load_tests' from /home/yahonda/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:52:in 'Rails::TestUnit::Runner.run' from /home/yahonda/src/github.com/rails/rails/tools/test.rb:18:in '<top (required)>' from bin/test:5:in 'Kernel#require_relative' from bin/test:5:in '<main>' $ ```
Current Rails main branch supports Ruby 3.1.0 and higher, Once newer version of uri is available, we can add the uri as Active Support dependency. https://github.com/rails/rails/blob/main/activesupport/activesupport.gemspec |
I meant to say I'm happy if the newer version of |
This feature is not security fix, it's impossible to backport to Ruby 3.1 with our maintenance policy. But URI-0.12.3 is also working Ruby 3.1. |
It is little bit off-topic for this request itself, I'm wondering how to write gemspec I want to install uri version 0.12.3 on Ruby 3.1.z and Ruby 3.2.z and uri version 0.13.1 on Ruby 3.3.z. Also I'd like to avoid uri version 0.13.1 is installed for Ruby 3.1.z and 3.2.z.
It should install the requried uri versions for Ruby 3.1.z and 3.2.z. |
Is there a problem with requiring the latest |
I released https://github.com/ruby/uri/releases/tag/v0.12.3 and https://github.com/ruby/uri/releases/tag/v0.13.1. They are also released with next stable versions, see ruby/ruby#11465 and ruby/ruby#11466. Q. Why we deprecate them? A. I and @yahonda ask that to @nurse in this week. |
Thank you for releasing the v0.12.3 and v0.13.1. Considering the current RubyGem dependency resolution, I think Rails need to add |
I'll open a pull request to rails/rails and will inform if there are some issues happens. |
Opened rails/rails#52779 |
Closing this issue as rails/rails#52779 has been merged to Rails main branch. |
This pull request allows `URI::RFC3986_PARSER` warnings appeared since https://buildkite.com/rails/rails-nightly/builds/931 This warning has been implemented to Ruby master branch via ruby/ruby@b41d799 and the original pull request for URI is ruby/uri#114 We are not able to just replace `URI::DEFAULT_PARSER` with `URI::RFC2396_PARSER` because `URI::RFC2396_PARSER` gets `uninitialized constant URI::RFC2396_PARSER (NameError)` with Ruby 3.3.4 as reported ruby/uri#118 We can revert this commit and replace `URI::DEFAULT_PARSER` with `URI::RFC2396_PARSER` once `URI::RFC2396_PARSER` is available for uri bundled with Ruby 3.3.4 or older versions. - This commit allows the warning below and let Rails CI against Ruby master branch run ``` $ RAILS_STRICT_WARNINGS=1 bin/test test/abstract/callbacks_test.rb /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2063: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly. /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/testing/strict_warnings.rb:35:in 'ActiveSupport::RaiseWarnings#warn': /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2063: warning: URI::RFC3986_PARSER.escape is obsoleted. Use URI::RFC2396_PARSER.escape explicitly. (ActiveSupport::RaiseWarnings::WarningError) from <internal:warning>:54:in 'Kernel#warn' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/uri/rfc3986_parser.rb:156:in 'URI::RFC3986_Parser#escape' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2063:in 'ActionDispatch::Routing::Mapper::Resources#add_route' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2038:in 'ActionDispatch::Routing::Mapper::Resources#decomposed_match' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:2002:in 'block in ActionDispatch::Routing::Mapper::Resources#map_match' from <internal:array>:53:in 'Array#each' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:1996:in 'ActionDispatch::Routing::Mapper::Resources#map_match' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:1739:in 'ActionDispatch::Routing::Mapper::Resources#match' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:798:in 'ActionDispatch::Routing::Mapper::HttpHelpers#map_method' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/mapper.rb:741:in 'ActionDispatch::Routing::Mapper::HttpHelpers#get' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract_unit.rb:71:in 'block (2 levels) in <top (required)>' from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/deprecation/reporting.rb:43:in 'ActiveSupport::Deprecation::Reporting#silence' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract_unit.rb:70:in 'block in <top (required)>' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:479:in 'BasicObject#instance_exec' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:479:in 'ActionDispatch::Routing::RouteSet#eval_block' from /home/yahonda/src/github.com/rails/rails/actionpack/lib/action_dispatch/routing/route_set.rb:461:in 'ActionDispatch::Routing::RouteSet#draw' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract_unit.rb:69:in '<top (required)>' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'Kernel.require' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'block (2 levels) in Kernel#replace_require' from /home/yahonda/src/github.com/rails/rails/actionpack/test/abstract/callbacks_test.rb:3:in '<top (required)>' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'Kernel.require' from /home/yahonda/.rbenv/versions/trunk/lib/ruby/3.4.0+0/bundled_gems.rb:75:in 'block (2 levels) in Kernel#replace_require' from /home/yahonda/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:62:in 'block in Rails::TestUnit::Runner.load_tests' from <internal:array>:53:in 'Array#each' from /home/yahonda/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:60:in 'Rails::TestUnit::Runner.load_tests' from /home/yahonda/src/github.com/rails/rails/railties/lib/rails/test_unit/runner.rb:52:in 'Rails::TestUnit::Runner.run' from /home/yahonda/src/github.com/rails/rails/tools/test.rb:18:in '<top (required)>' from bin/test:5:in 'Kernel#require_relative' from bin/test:5:in '<main>' $ ```
almost there. the installer completes and everything runs but there's an issue with the ruby URI module possibly related to ruby/uri#118
This issue requests to provide
URI::RFC2396_PARSER
for Ruby 3.3 or older version because Ruby on Rails supports Ruby 3.1.0 and higher and I want to support these Ruby versions without if RUBY_VERSION clauses.Background
Ruby on Rails runs CI against Ruby master branch and it enables
RAILS_STRICT_WARNINGS=1
flag to let Rails CI fail if any warnings appeared.Since ruby/ruby@b41d799, Rails Ci against Ruby master branch is getting failed as expected. To address this warning, I have replaced
URI::DEFAULT_PARSER.escape
withURI::RFC2396_PARSER.escape
as suggested. It works against Ruby master branch but it raisesuninitialized constant URI::RFC2396_PARSER (NameError)
against Ruby 3.3.4 that bundles uri version 0.13.0Steps to reproduce
$ irb -w
Expected behavior
Ruby 3.3.4 runs these statements without successfully warnings.
Actual behavior
It raises
uninitialized constant URI::RFC2396_PARSER (NameError)
Here is the result against Ruby 3.4.0dev, that works as expected.
The text was updated successfully, but these errors were encountered: