Skip to content

Embedded parser mode fails on JRuby due to loaded feature diffs #94

Description

@headius

The "embedded" mode that inlines racc sources fails to work on JRuby due to differences in how Ruby "loaded features" are managed. This leads to the following test failures:

Failure:
Racc::TestRaccCommand#test_echk_y [/Users/headius/projects/racc/test/test_racc_command.rb:50]:
LoadError: no such file to load -- racc/info
      require at org/jruby/RubyKernel.java:976
      require at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:59
       (eval) at racc/parser.rb:10
  module_eval at org/jruby/RubyModule.java:3054
       <main> at test/tab/echk:48

This happens because loaded features in JRuby are currently usually the full system path to the relevant file. The embedding logic attempts to short circuit e.g. racc/info by inserting racc/info.rb into the loaded features global.

This is a bug in JRuby but I am filing this to discuss whether we might come up with a more robust way to embed those sources, such as actually removing all requires rather than modifying loaded features directly.

Relates to #93.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions