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

Don't unconditionally emit debug level info from RACC #4881

Merged
merged 1 commit into from Dec 5, 2017

Conversation

@haus
Copy link
Contributor

@haus haus commented Dec 1, 2017

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.

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.
@haus
Copy link
Contributor Author

@haus haus commented Dec 1, 2017

As an example, Puppet leverages yyparse at runtime. With jruby 9.1.14.0 from homebrew, simply running jruby -rpuppet dumps approximately 18000 lines of yyparse debug output to the console. 9.1.12.0 and earlier do not have this behavior.

@headius
Copy link
Member

@headius headius commented Dec 5, 2017

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).

@headius headius merged commit 80b3b3d into jruby:jruby-9.1 Dec 5, 2017
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
@haus
Copy link
Contributor Author

@haus haus commented Dec 6, 2017

Ah thanks. I'll open a ticket on their end as well.

@headius
Copy link
Member

@headius headius commented Dec 6, 2017

@haus Link it here when you do. Thanks again!

@haus
Copy link
Contributor Author

@haus haus commented Dec 7, 2017

@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.

@enebo enebo added this to the JRuby 9.1.15.0 milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.