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

Error: File name too long - Building search index ends up in infinite recursion #965

Closed
Stiivi opened this issue May 3, 2018 · 1 comment

Comments

@Stiivi
Copy link

Stiivi commented May 3, 2018

Running Jazzy version 0.9.2 on a Swift PM project with generated .xcodeproj results in infinite recursion and ends with "Filename too long" error. The directory tree Jazzy generates looks like this.

EDIT: This happens only on subsequent runs. First time it generates docs/* files correctly. To prevent this error one has to delete the generated content first.

Here is the output:

$ jazzy -m Compiler                                                                                                                                                                                       
Running xcodebuild                                                                                                                                                                                                                            
Parsing AST.swift (1/5)                                                                                                                                                                                                                       
Parsing CharacterSet+extensions.swift (2/5)                                                                                                                                                                                                   
Parsing Compiler.swift (3/5)                                                                                                                                                                                                                  
Parsing Grammar.swift (4/5)                                                                                                                                                                                                                   
Parsing Lexer.swift (5/5)                                                                                                                                                                                                                     
51% documentation coverage with 16 undocumented symbols                                                                                                                                                                                       
included 33 public or open symbols                                                                                                                                                                                                            
skipped 69 private, fileprivate, or internal symbols (use `--min-acl` to specify a different minimum ACL)                                                                                                                                     
building site                                                                                                                                                                                                                                 
building search index                                                                                                                                                                                                                         
Traceback (most recent call last):                                                                                                                                                                                                            
        281: from /usr/local/bin/jazzy:23:in `<main>'                                                                                                                                                                                         
        280: from /usr/local/bin/jazzy:23:in `load'                                                                                                                                                                                           
        279: from /usr/local/lib/ruby/gems/2.5.0/gems/jazzy-0.9.2/bin/jazzy:15:in `<top (required)>'                                                                                                                                          
        278: from /usr/local/lib/ruby/gems/2.5.0/gems/jazzy-0.9.2/lib/jazzy/doc_builder.rb:77:in `build'                                                                                                                                      
        277: from /usr/local/lib/ruby/gems/2.5.0/gems/jazzy-0.9.2/lib/jazzy/doc_builder.rb:157:in `build_docs_for_sourcekitten_output'                                                                                                        
        276: from /usr/local/lib/ruby/gems/2.5.0/gems/jazzy-0.9.2/lib/jazzy/doc_builder.rb:130:in `build_site'                                                                                                                                
        275: from /usr/local/lib/ruby/gems/2.5.0/gems/jazzy-0.9.2/lib/jazzy/docset_builder.rb:28:in `build!'                                                                                                                                  
        274: from /usr/local/lib/ruby/gems/2.5.0/gems/jazzy-0.9.2/lib/jazzy/docset_builder.rb:65:in `copy_docs'                                                                                                                               
        273: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:392:in `cp_r'                                                                                                                                                      
        272: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1461:in `fu_each_src_dest'                                                                                                                                         
        271: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1470:in `fu_each_src_dest0'                                                                                                                                        
        270: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1470:in `each'                                                                                                                                                     
        269: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1472:in `block in fu_each_src_dest0'                                                                                                                               
        268: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1463:in `block in fu_each_src_dest'                                                                                                                                
        267: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:393:in `block in cp_r'                                                                                                                                             
        266: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:415:in `copy_entry'                                                                                                                                                
        265: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1392:in `wrap_traverse'                                                                                                                                            
        264: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1392:in `each'
        263: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1393:in `block in wrap_traverse'
        262: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1392:in `wrap_traverse'
        261: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1392:in `each'

       ... repeated

          8: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1393:in `block in wrap_traverse'
          7: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1390:in `wrap_traverse'
          6: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:418:in `block in copy_entry'
          5: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1259:in `copy'
          4: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1291:in `copy_file'
          3: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1291:in `open'
          2: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1292:in `block in copy_file'
          1: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1292:in `open'
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/fileutils.rb:1292:in `initialize': File name too long @ rb_sysopen - /Users/.../Sepro18/docs/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/Compiler.docset/Contents/Resources/Documents/docsets/.docset/Contents/Resources/Documents/Protocols/StreamConvertible.html (Errno::ENAMETOOLONG)
@johnfairh
Copy link
Collaborator

I think the problem is that a directory called 'Docs' (big D) has been created for the jazzy output on the regular case-insensitive mac filesystem. Jazzy's default for output is 'docs' (little d). Ruby on mac is set up to do case-sensitive filename comparisons which causes both the bits of Jazzy that are supposed to prevent this infinite copying, and the bits of Ruby fileutils that are supposed to notice it, to get bypassed.

I can recreate this easily by doing mv docs Docs on a previously working project, & the root of your filetree gist says Docs (so thank you for providing that!)

Fix for your project is mv Docs docs - I'm not sure what if anything jazzy could do better here, will think about it...

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

No branches or pull requests

2 participants