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

Ruby 2.8.0 removes rexml gem then Gemfile or gemspec needs to add rexml gem explicitly #871

Closed
yahonda opened this issue Apr 1, 2020 · 4 comments · Fixed by #899
Closed
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@yahonda
Copy link
Contributor

yahonda commented Apr 1, 2020

Ruby 2.8.0 removes rexml gem then Gemfile or gemspec needs to add rexml gem explicitly.

Environment details

  • OS: macOS 10.15.5 Beta (19F53f)
  • Ruby version: ruby 2.8.0dev (2020-04-01T10:29:39Z master fad0a1451b) [x86_64-darwin19]
  • Gem name and version: google-api-client master branch

Steps to reproduce

  1. rbenv install 2.8.0-dev ; rbenv global 2.8.0 (or whatever install Ruby 2.8.0-dev)
  2. git clone https://github.com/googleapis/google-api-ruby-client.git
  3. cd google-api-ruby-client
  4. bundle install
  5. bundle exec rake

Expected behavior

It should pass.

Actual result

It gets this error. Entire output is https://gist.github.com/yahonda/f4eb287756e9656b0580def1c3d8291f

LoadError:
  cannot load such file -- rexml/parsers/streamparser
# ./spec/spec_helper.rb:42:in `require'
# ./spec/spec_helper.rb:42:in `<top (required)>'
# ./spec/google/api_client/auth/installed_app_spec.rb:1:in `require'
# ./spec/google/api_client/auth/installed_app_spec.rb:1:in `<top (required)>'

Code example

I have confirmed this change addresses this error.

% git diff master                                                                                                                                                                                         ruby280
diff --git a/google-api-client.gemspec b/google-api-client.gemspec
index 699e5f25..62cb80f5 100644
--- a/google-api-client.gemspec
+++ b/google-api-client.gemspec
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
   spec.add_runtime_dependency 'signet', '~> 0.12'
   spec.add_runtime_dependency 'googleauth', '~> 0.9'
   spec.add_runtime_dependency 'httpclient', '>= 2.8.1', '< 3.0'
+  spec.add_runtime_dependency 'rexml'
   spec.add_development_dependency 'thor', '~> 0.19'
   spec.add_development_dependency 'activesupport', '>= 4.2', '< 5.1'
 end

Additional information

Cons: The users need to add rexml to their Gemfile after Ruby 2.8(3.0)

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Apr 2, 2020
@dazuma dazuma added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed triage me I really want to be triaged. labels Apr 7, 2020
@dazuma
Copy link
Member

dazuma commented Apr 7, 2020

Will adding the rexml gem to dependencies cause issues for earlier versions of Ruby? (i.e. does the gem work back to Ruby 2.4.x or will it conflict with the standard library copy of rexml?)

@yahonda
Copy link
Contributor Author

yahonda commented Apr 10, 2020

I think it is safe to add rexml gem to dependencies because rexml CI has been running against Ruby 2.4 and higher.

https://github.com/ruby/rexml/blob/be62163ba12a6657679a34e472b1d29d75e0e881/.travis.yml#L6-L13

@yahonda
Copy link
Contributor Author

yahonda commented Apr 22, 2020

I have opened ruby/rexml#28 and confirmed my assumption is correct.

ruby/rexml#28 (comment)

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Jul 21, 2020
@yahonda
Copy link
Contributor Author

yahonda commented Sep 2, 2020

Opened #899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants