Don't unconditionally emit debug level info from RACC#4881
Don't unconditionally emit debug level info from RACC#4881headius merged 1 commit intojruby:jruby-9.1from haus:jruby-9.1-dont-emit-debug-in-racc
Conversation
In 3fe1cc2, jruby's version of racc/parser.rb was brought in line with MRI racc/parser.rb. This brought along a change to the yyparse method which changed the last argument from false to true. This causes the java racc parser implementation to unconditionally emit very noisy debug output whenever yyparse is called, where previously it would not emit such output. Passing true is safe for the pure ruby parser, as it ignores the argument entirely and does nothing with it. It is also safe for the native c parser, as that parser only emits debug info if it is compiled with DEBUG set. Tenderlove's version of racc disabled debug by default in ruby/racc@c5359ab, but it looks like MRI never picked up that change. For a time, true was passed and debugging info was not emitted (between 9.1.9.0 and 9.1.12.0). This was because in the merge to bring racc/parser.rb in line with MRI, the loading of the java cparse library no longer happened, so the pure ruby version of the library was used which ignores the debug parameter entirely. This changed in baeaad1 when the cparse-java.jar was being loaded again for jruby.
|
As an example, Puppet leverages yyparse at runtime. With jruby 9.1.14.0 from homebrew, simply running |
|
Good find! Perhaps you should file an issue with MRI to get them on the same page? They are gemifying libraries for 2.5, but I don't believe racc is one of them (so it won't get updated unless they update it manually). |
|
Ah thanks. I'll open a ticket on their end as well. |
|
@haus Link it here when you do. Thanks again! |
|
@headius i opened https://bugs.ruby-lang.org/issues/14158 for the general case of update racc with upstream changes. if you think i should be more specific and ask for this particular change to be brought over, i can update the ticket. |
In
3fe1cc2,
jruby's version of racc/parser.rb was brought in line with MRI
racc/parser.rb. This brought along a change to the yyparse method which
changed the last argument (the c_debug/sysdebug argument) from false to true. This causes the java racc
parser implementation to unconditionally emit very noisy debug output
whenever yyparse is called, where previously it would not emit such
output. Passing true is safe for the pure ruby parser, as it ignores the
argument entirely and does nothing with it. It is also safe for the
native c parser, as that parser only emits debug info if it is compiled
with DEBUG set. Tenderlove's version of racc disabled debug by default
in
ruby/racc@c5359ab,
but it looks like MRI never picked up that change.
For a time, true was passed and debugging info was not emitted (between
9.1.9.0 and 9.1.12.0). This was because in the merge to bring
racc/parser.rb in line with MRI, the loading of the java cparse library
no longer happened, so the pure ruby version of the library was used
which ignores the debug parameter entirely. This changed in
baeaad1
when the cparse-java.jar was being loaded again for jruby.