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

Jazzy is not working for macOS Mojave 10.14.5. Please update #1083

Closed
iOSEnthu opened this issue Jul 9, 2019 · 10 comments
Closed

Jazzy is not working for macOS Mojave 10.14.5. Please update #1083

iOSEnthu opened this issue Jul 9, 2019 · 10 comments
Labels

Comments

@iOSEnthu
Copy link

iOSEnthu commented Jul 9, 2019

No description provided.

@johnfairh
Copy link
Collaborator

It should work fine; can you explain exactly what problem you're seeing with what version of jazzy & Xcode?

@iOSEnthu
Copy link
Author

iOSEnthu commented Jul 10, 2019

Xcode v10.2.1 & jazzy v0.10.0. Here is the log:

from /usr/local/lib/ruby/gems/2.4.0/gems/jazzy-0.10.0/lib/jazzy/sourcekitten.rb:230:in run_sourcekitten' from /usr/local/lib/ruby/gems/2.4.0/gems/jazzy-0.10.0/lib/jazzy/doc_builder.rb:65:in block in build'
from /usr/local/lib/ruby/gems/2.4.0/gems/jazzy-0.10.0/lib/jazzy/doc_builder.rb:63:in chdir' from /usr/local/lib/ruby/gems/2.4.0/gems/jazzy-0.10.0/lib/jazzy/doc_builder.rb:63:in build'
from /usr/local/lib/ruby/gems/2.4.0/gems/jazzy-0.10.0/bin/jazzy:15:in <top (required)>' from /usr/local/bin/jazzy:23:in load'
from /usr/local/bin/jazzy:23:in `

'

@johnfairh
Copy link
Collaborator

(hadn't noticed the previous edit)
It looks like sourcekitten is giving an error.

Does /usr/local/lib/ruby/gems/2.4.0/gems/jazzy-0.10.0/bin/sourcekitten run properly? (should show help).

Will need to see exactly what the problem is: the full command output & invocation params/param file -- could be you have something unexpected in there.

@heidiproske
Copy link

heidiproske commented Jul 19, 2019

I'm seeing the same issue and am also running Xcode 10.2.1 on Mojave 10.14.5:

...
Parsing FileV.swift (93/278)
Parsing FileW.swift (94/278)
Parsing FileX.swift (95/278)
	from /Users/me/.rvm/gems/ruby-2.3.0@someId/gems/jazzy-0.10.0/lib/jazzy/sourcekitten.rb:230:in `run_sourcekitten'
	from /Users/me/.rvm/gems/ruby-2.3.0@someId/gems/jazzy-0.10.0/lib/jazzy/doc_builder.rb:65:in `block in build'
	from /Users/me/.rvm/gems/ruby-2.3.0@someId/gems/jazzy-0.10.0/lib/jazzy/doc_builder.rb:63:in `chdir'
	from /Users/me/.rvm/gems/ruby-2.3.0@someId/gems/jazzy-0.10.0/lib/jazzy/doc_builder.rb:63:in `build'
	from /Users/me/.rvm/gems/ruby-2.3.0@someId/gems/jazzy-0.10.0/bin/jazzy:15:in `<top (required)>'
	from /Users/me/.rvm/gems/ruby-2.3.0@someId/bin/jazzy:23:in `load'
	from /Users/me/.rvm/gems/ruby-2.3.0@someId/bin/jazzy:23:in `<main>'
	from /Users/me/.rvm/gems/ruby-2.3.0@someId/bin/ruby_executable_hooks:24:in `eval'
	from /Users/me/.rvm/gems/ruby-2.3.0@someId/bin/ruby_executable_hooks:24:in `<main>'

So it just dies.

And yes sourcekitten runs fine.

$ /Users/me/.rvm/gems/ruby-2.3.0@someId/gems/jazzy-0.10.0/bin/sourcekitten
Available commands:

   complete      Generate code completion options
   doc           Print Swift or Objective-C docs as JSON
   format        Format Swift file
   help          Display general or command-specific help
   index         Index Swift file and print as JSON
   module_info   Obtain information about a Swift module and print as JSON
   request       Run a raw sourcekit request
   structure     Print Swift structure information as JSON
   syntax        Print Swift syntax information as JSON
   version       Display the current version of SourceKitten
$ /Users/me/.rvm/gems/ruby-2.3.0@someId/gems/jazzy-0.10.0/bin/sourcekitten version
0.23.2

It was working fine a little while ago (last saved successful log I can find is with jazzy 0.9.4) but we've since updated our version. I tried to roll back to 0.9.6 but it's tied to an older version of cocoapods (~> 1.5.3) and we're on 1.6.x.

PS: I know my ruby is behind but the job is also failing on Jenkins machines using ruby 2.5.3

@johnfairh
Copy link
Collaborator

This looks like sourcekitten / sourcekit is crashing while parsing one of the Swift files. I assume you cannot share the project; if it is always the same file then it might be possible to isolate what code is going wrong and come up with a minimal recreate.

@johnfairh johnfairh added the bug label Jul 19, 2019
@heidiproske
Copy link

Cool I’ll try divide and conquer tonight - will post back!

@heidiproske
Copy link

@johnfairh Aaah finally I figured it out - it's when someone puts a triple slash comment inside of a function :) For example:

func causeHavocOnSourceKitten() {
    /// Who would think a single extra slash could cause such issues.
}

adding the above func containing that triple slash comment inside of your source will reproduce the jazzy error I saw (and maybe same for @iOSEnthu).

Note that the file in the project I'm on has existed since January (and we've run jazzy a number of times since then) so it's definitely a recent change where someone seems to have updated sourcekitten to be more fussy? :)

I've updated the scandalous triple slash to a normal double slash and our jazzy Jenkins job is working fine again :)

@johnfairh
Copy link
Collaborator

Thanks for this pointer. The sample above doesn't recreate for me, but I took an existing project and replaced every // with /// and hit a crash. It's a recently-introduced problem in sourcekitten, roughly "crash when there's a doc comment on an expression that references a declaration made in a different source file at a byte offset larger than the size of the referring source file".

Workaround is simple as you've found; I'll fix sourcekitten in the next few days.

@johnfairh
Copy link
Collaborator

Recreate: 2-file project, a.swift:

// 12345678901234567890
// 12345678901234567890
func ff() {}

b.swift:

func gg() {
    /// Bang
    ff()
}

@johnfairh
Copy link
Collaborator

Fixed in master via #1089 including sourcekitten 0.25.0

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

No branches or pull requests

3 participants