-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Yard does not work in JRuby =>9.1.3.0 #4363
Comments
Can you show us an example of the problem? I'm not a yard user. |
Running the test suite of YARD makes JRuby 9.1.6.0 confused. This works on JRuby 9.1.2.0 and fails on higher versions: bundle exec rspec spec/code_objects/base_spec.rb:405 There's a bit of re-setting back to CLI defaults using some metaprogramming. Here's one test-case which fails on JRuby 9.1.6.0:
https://github.com/lsegal/yard/blob/master/spec/templates/helpers/shared_signature_examples.rb https://github.com/lsegal/yard/blob/master/lib/yard/options.rb#L188-L199 ...FFFFFFFFFFFF..... Failures:
Finished in 2.44 seconds (files took 1.79 seconds to load) Failed examples: rspec './spec/templates/helpers/text_helper_spec.rb[1:1:1:4]' # YARD::Templates::Helpers::TextHelper#signature it should behave like signature shows signature for private class method Hm. It seems it uses something called "thread-local store": |
Woo even after narrowing this down with a bisect it took a while to get it: nodes = [1]
nodes.each.with_index do |node, index|
puts node
nodes.insert index + 1, *[2, 3, 4] if node == 1
end The if is just so this does not run forever. JRuby will only print 1 and MRI will print 1,2,3,4. |
Closing the loop... The problem was that the newish packed arrays had a couple block-receiving methods that did not handle modification during iteration. So if it was a one or two element array and you did NOTE: Matz himself has said that modification during iteration is an undefined behavior, so technically we were not doing anything wrong here. However, the fix was simple so we went ahead with it. I do not recommend relying on this behavior. |
@petr666 This change is a fix for the test that I noted, but it will not make all of YARD's behavior work in JRuby. I have set up a Travis build with YARD's test suite on my own Github fork. It shows lots of test failures on I recommend running |
Since JRuby 9.1.3.0 yard stopped working. More precisely it is probably not able to align comments with actual elements. Same project, same version of yard, "documented" dropped from 100% to 28.57%. Also it started to print warning "Unknown tag @host", however there is no such tag in comments and this warning is generated based on commented instance variable within method implementation (therefore I guess there is some problem with comment alignment).
Everything is working as expected in JRuby 9.1.2.0 and older (including 1.7.x)
The text was updated successfully, but these errors were encountered: