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

LoadError: no such file to load -- racc/info when using JRuby 9.2.15.0 #6581

Closed
koic opened this issue Feb 26, 2021 · 3 comments
Closed

LoadError: no such file to load -- racc/info when using JRuby 9.2.15.0 #6581

koic opened this issue Feb 26, 2021 · 3 comments
Labels

Comments

@koic
Copy link

koic commented Feb 26, 2021

Environment Information

Provide at least:

  • % jruby -v
    jruby 9.2.15.0 (2.5.7) 2021-02-24 aa05fda Java HotSpot(TM) 64-Bit Server VM 25.271-b09 on 1.8.0_271-b09 +jit [darwin-x86_64]
  • Darwin atelier.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64

Other relevant info you may wish to add:

  • Installed or activated gems
% gem list parser

*** LOCAL GEMS ***

parser (3.0.0.0)
regexp_parser (2.1.1)

Expected Behavior

There is no error like JRuby 9.2.14.0.

# JRuby 9.2.14.0
% ruby -v
jruby 9.2.14.0 (2.5.7) 2020-12-08 ebe64bafb9 Java HotSpot(TM) 64-Bit Server VM 25.271-b09 on 1.8.0_271-b09 +jit [darwin-x86_64]
% ruby -rparser -e 'Parser'

Actual Behavior

LoadError: no such file to load -- racc/info error will occur.

#!/bin/bash -eo pipefail
bundle exec rake internal_investigation
rake aborted!
LoadError: no such file to load -- racc/info
/usr/local/bundle/gems/parser-3.0.0.0/lib/parser.rb:12:in `<main>'
/usr/local/bundle/gems/rubocop-ast-1.4.1/lib/rubocop/ast.rb:3:in
`<main>'
/usr/local/bundle/gems/rubocop-ast-1.4.1/lib/rubocop-ast.rb:3:in
`<main>'
/home/circleci/project/lib/rubocop.rb:14:in `<main>'
tasks/cops_documentation.rake:4:in `<main>'
/home/circleci/project/Rakefile:21:in `block in <main>'
/home/circleci/project/Rakefile:21:in `<main>'
/opt/jruby/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

Exited with code exit status 1
CircleCI received exit code 1

I encountered this issue in RuboCop's CI build.
https://app.circleci.com/pipelines/github/rubocop/rubocop/4118/workflows/a4451248-05e0-4361-963d-2297357e7885/jobs/174452

koic added a commit to koic/rubocop that referenced this issue Feb 26, 2021
This PR pins the JRuby CI image to 9.2.14 to avoid the following error
in JRuby 9.2.15.0:

```console
#!/bin/bash -eo pipefail
bundle exec rake internal_investigation
rake aborted!
LoadError: no such file to load -- racc/info
/usr/local/bundle/gems/parser-3.0.0.0/lib/parser.rb:12:in `<main>'
/usr/local/bundle/gems/rubocop-ast-1.4.1/lib/rubocop/ast.rb:3:in
`<main>'
/usr/local/bundle/gems/rubocop-ast-1.4.1/lib/rubocop-ast.rb:3:in
`<main>'
/home/circleci/project/lib/rubocop.rb:14:in `<main>'
tasks/cops_documentation.rake:4:in `<main>'
/home/circleci/project/Rakefile:21:in `block in <main>'
/home/circleci/project/Rakefile:21:in `<main>'
/opt/jruby/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

Exited with code exit status 1
CircleCI received exit code 1
```

https://app.circleci.com/pipelines/github/rubocop/rubocop/4118/workflows/a4451248-05e0-4361-963d-2297357e7885/jobs/174452

This is an error when JRuby 9.2.15.0 CI image is executed locally.

```console
% docker run --rm -it circleci/jruby:9.2.15.0 /bin/sh -c 'gem i parser; ruby -rparser'
Unable to find image 'circleci/jruby:9.2.15.0' locally
9.2.15.0: Pulling from circleci/jruby
(snip)

Digest:
sha256:a7705120e8a76ee0f3b0d524e28f6be81534c04fd3c8ab6d9126559ca2cb2dc6
Status: Downloaded newer image for circleci/jruby:9.2.15.0
Fetching ast-2.4.2.gem
Fetching parser-3.0.0.0.gem
Successfully installed ast-2.4.2
Successfully installed parser-3.0.0.0
2 gems installed
LoadError: no such file to load -- racc/info
  require at org/jruby/RubyKernel.java:974
  require at
  /opt/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54
   <main> at /opt/jruby/lib/ruby/stdlib/racc/parser.rb:13
  require at org/jruby/RubyKernel.java:974
  require at
  /opt/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54
   <main> at /usr/local/bundle/gems/parser-3.0.0.0/lib/parser.rb:12
  require at org/jruby/RubyKernel.java:974
  require at /opt/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:130
```

JRuby CI image could be changed back to `circleci/jruby:9.2` when
jruby/jruby#6581 will be resolved.
@dgolombek
Copy link

We're running into this with 9.2.15.0 and trying to invoke RuboCop

@headius
Copy link
Member

headius commented Feb 26, 2021

Workaround: install and explicitly activate the racc gem. The problem here is that the built-in racc in JRuby only includes a subset of the racc files, but since it is not set up as a default gem requiring racc will not activate any upgraded gem. You end up with only a subset of racc sources being available, leading to this issue.

This will be fixed in .16 by #6576. We had originally intended to make this change in .15 but suspected it was breaking our snapshot deployment. That turned out not to be the case, but it was too late to make the release.

@headius headius added this to the JRuby 9.2.16.0 milestone Feb 26, 2021
@headius headius added the stdlib label Feb 26, 2021
@headius
Copy link
Member

headius commented Feb 28, 2021

Please confirm that this is fixed in 9.2.16 by building the jruby-9.2 branch or downloading a snapshot build from https://www.jruby.org/nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants