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

Workaround for Parser 3.2.2.2 or lower with Ruby 3.3.0dev #11941

Merged
merged 1 commit into from Jun 8, 2023

Conversation

koic
Copy link
Member

@koic koic commented Jun 8, 2023

Follow up ruby/ruby#7877.

Ruby 3.3.0dev is set to promote Racc to a bundled gem. Therefore, this PR provides a workaround for Parser 3.2.2.2 or lower with Ruby 3.3.0dev to prevents the following Ruby 3.3.0dev CI matrix error:

bundle exec rake internal_investigation

rake aborted!
LoadError: cannot load such file -- racc/parser
<internal:/usr/local/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/usr/local/bundle/gems/parser-3.2.2.1/lib/parser.rb:12:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/usr/local/bundle/gems/rubocop-ast-1.29.0/lib/rubocop/ast.rb:3:in `<top (required)>'
/usr/local/bundle/gems/rubocop-ast-1.29.0/lib/rubocop-ast.rb:3:in `require_relative'
/usr/local/bundle/gems/rubocop-ast-1.29.0/lib/rubocop-ast.rb:3:in `<top (required)>'

https://app.circleci.com/pipelines/github/rubocop/rubocop/9387/workflows/c308ef87-1373-4c0a-b90d-a22ea57860e3/jobs/279345

I opened PR whitequark/parser#929 to add Racc as a runtime dependency to the Parser gem. When the Praser gem releases a new version of Racc that includes the runtime dependencies, it will be able to upgrade the Parser gem dependency and remove the workaround.

RuboCop's support for Ruby 3.3.0dev is experimental and additions of Racc to the runtime have not been made, as I believe the solution proposed in whitequark/parser#929 is the best.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

Follow up ruby/ruby#7877.

Ruby 3.3.0dev is set to promote Racc to a bundled gem.
Therefore, this PR provides a workaround for Parser 3.2.2.2 or lower with Ruby 3.3.0dev
to prevents the following Ruby 3.3.0dev CI matrix error:

```console
bundle exec rake internal_investigation

rake aborted!
LoadError: cannot load such file -- racc/parser
<internal:/usr/local/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/usr/local/bundle/gems/parser-3.2.2.1/lib/parser.rb:12:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/local/lib/ruby/3.3.0+0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/usr/local/bundle/gems/rubocop-ast-1.29.0/lib/rubocop/ast.rb:3:in `<top (required)>'
/usr/local/bundle/gems/rubocop-ast-1.29.0/lib/rubocop-ast.rb:3:in `require_relative'
/usr/local/bundle/gems/rubocop-ast-1.29.0/lib/rubocop-ast.rb:3:in `<top (required)>'
```

https://app.circleci.com/pipelines/github/rubocop/rubocop/9387/workflows/c308ef87-1373-4c0a-b90d-a22ea57860e3/jobs/279345

I opened PR whitequark/parser#929 to add Racc as a runtime dependency to the Parser gem.
When the Praser gem releases a new version of Racc that includes the runtime dependencies,
it will be able to upgrade the Parser gem dependency and remove the workaround.

RuboCop's support for Ruby 3.3.0dev is experimental and additions of Racc to the runtime have not been made,
as I believe the solution proposed in whitequark/parser#929 is the best.
@koic koic merged commit 469d74a into rubocop:master Jun 8, 2023
28 checks passed
@koic koic deleted the workaround_for_ruby_3_3_0_and_racc branch June 8, 2023 17:29
tk0miya added a commit to tk0miya/rbs that referenced this pull request Jun 13, 2023
Follow up ruby/ruby#7877.

Ruby 3.3.0dev is set to promote Racc to a bundled gem. Therefore,
this PR provides a workaround for Parser 3.2.2.2 or lower with Ruby
3.3.0dev to prevents the Ruby 3.3.0dev CI matrix error from rubocop.

refs: rubocop/rubocop#11941
@tk0miya tk0miya mentioned this pull request Jun 13, 2023
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

1 participant