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 docs generation workflow #1428

Merged
merged 42 commits into from
Jun 30, 2022
Merged

Jazzy docs generation workflow #1428

merged 42 commits into from
Jun 30, 2022

Conversation

maratal
Copy link
Collaborator

@maratal maratal commented Jun 5, 2022

No description provided.

@maratal maratal marked this pull request as draft June 5, 2022 17:29
@github-actions github-actions bot had a problem deploying to staging/pull/1428/jazzydoc June 5, 2022 17:38 Failure
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 9, 2022 11:12 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 9, 2022 14:16 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 9, 2022 19:28 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 10, 2022 17:19 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 10, 2022 17:28 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 10, 2022 17:51 Inactive
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting an error when I try to run Scripts/jazzy.sh locally - does it work for you?

$ ./Scripts/jazzy.sh

/Users/lawrence/code/ably/ably-cocoa/Source/include/Ably/Ably.h:1:9: fatal error: could not build module 'Foundation'
/Users/lawrence/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/jazzy-0.14.2/lib/jazzy/sourcekitten.rb:657:in `block in expand_extensions': undefined method `include?' for nil:NilClass (NoMethodError)
        from /Users/lawrence/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/jazzy-0.14.2/lib/jazzy/sourcekitten.rb:656:in `map'
        from /Users/lawrence/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/jazzy-0.14.2/lib/jazzy/sourcekitten.rb:656:in `expand_extensions'
        from /Users/lawrence/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/jazzy-0.14.2/lib/jazzy/sourcekitten.rb:1080:in `parse'
        from /Users/lawrence/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/jazzy-0.14.2/lib/jazzy/doc_builder.rb:155:in `build_docs_for_sourcekitten_output'
        from /Users/lawrence/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/jazzy-0.14.2/lib/jazzy/doc_builder.rb:86:in `build'
        from /Users/lawrence/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/jazzy-0.14.2/bin/jazzy:16:in `<top (required)>'
        from /Users/lawrence/.rbenv/versions/3.0.0/bin/jazzy:23:in `load'
        from /Users/lawrence/.rbenv/versions/3.0.0/bin/jazzy:23:in `<main>'

Gemfile Show resolved Hide resolved
Scripts/jazzy.sh Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 14, 2022 22:19 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 14, 2022 23:12 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 14, 2022 23:21 Inactive
@maratal
Copy link
Collaborator Author

maratal commented Jun 15, 2022

/Users/runner/work/ably-cocoa/ably-cocoa/Source/include/Ably/ARTDeltaCodec.h:2:9: fatal error: 'AblyDeltaCodec/AblyDeltaCodec.h' file not found error was due to absence of dependencies. I've added this step here 94bfab9

Also there were multiple warnings like warning: no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed [-Wobjc-property-no-attribute]. I've created a separate issue for that: #1433

Regarding local jazzy command. Strangely enough I began experiencing the same error /Users/lawrence/code/ably/ably-cocoa/Source/include/Ably/Ably.h:1:9: fatal error: could not build module 'Foundation', but only after I've installed sourcekitten and used it directly like that:

sourcekitten doc --objc $(pwd)/Source/Ably.h \
      -- -x objective-c  -isysroot $(xcrun --show-sdk-path --sdk iphoneos) \
      -I $(pwd) -fmodules > objcDoc.json

jazzy command works without issues. I still have Big Sur and ruby 2.6.3 though, will update to Monterey and check it again. But CI build is now clean. @lawrence-forooghian

@lawrence-forooghian
Copy link
Collaborator

@maratal great news about the CI build, thanks!

As for my local issues, I just tried with Ruby 2.6.3, didn't make a difference, still get the error. As for the rest of my environment, I'm on macOS 12.4, Xcode 13.4.1.

@maratal
Copy link
Collaborator Author

maratal commented Jun 16, 2022

@maratal great news about the CI build, thanks!

As for my local issues, I just tried with Ruby 2.6.3, didn't make a difference, still get the error. As for the rest of my environment, I'm on macOS 12.4, Xcode 13.4.1.

Yes, after fresh install of macOS 12.4 and Xcode 13.4.1. it's now reproducible. @lawrence-forooghian

@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 16, 2022 20:30 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 16, 2022 21:52 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 17, 2022 01:00 Inactive
@maratal
Copy link
Collaborator Author

maratal commented Jun 17, 2022

Jazzy stopped crashing after I've replaced --framework-root . with --framework-root Source. But it still struggled with error 'AblyDeltaCodec/AblyDeltaCodec.h' file not found. Then there were some manipulations with the make command (make update_carthage_dependencies_<platform>). After that it never appeared again no matter what to cleanup and what --framework-root value was. So I can't say for sure what "fixed" this crash.

But like on previous macOS installation, when I installed sourcekitten separately, it was there again:

sourcekitten doc --objc $(pwd)/Source/Ably.h
  -- -x objective-c
  -isysroot $(xcrun --show-sdk-path --sdk iphoneos)
  -I $(pwd) -fmodules > objcDoc.json

/Users/admin/Work/ably-cocoa/Source/Ably.h:1:9: fatal error: could not build module 'Foundation'

After iphoneos was replaced to iphonesimulator (as suggested in this thread realm/jazzy#840):

sourcekitten doc --objc $(pwd)/Source/Ably.h
  -- -x objective-c
  -isysroot $(xcrun --show-sdk-path --sdk iphonesimulator)
  -I $(pwd) -fmodules > objcDoc.json

/Users/admin/Work/ably-cocoa/Source/Ably.h:9:9: fatal error: 'Ably/ARTLog.h' file not found

And after adding symlink to Source directory with the module name (as suggested in this article https://nicedoc.io/realm/jazzy/ObjectiveC.md):

/Users/admin/Work/ably-cocoa/Ably/ARTDeltaCodec.h:2:9: fatal error: 'AblyDeltaCodec/AblyDeltaCodec.h' file not found.

But proper objcDoc.json file was generated regardless this error.

Also, as that article suggests, playing with clang command might be helpful, as jazzy relies on that, but the thing is that it doesn't work even in our main branch:

clang -c -x objective-c -isysroot $(xcrun --show-sdk-path) -I $(pwd) Source/Ably.h -fmodules

In file included from Source/Ably.h:60:
/Users/admin/Work/ably-cocoa/Ably/ARTDeltaCodec.h:2:9: fatal error: 'AblyDeltaCodec/AblyDeltaCodec.h' file not found
#import <AblyDeltaCodec/AblyDeltaCodec.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Adding -F to pass Carthage frameworks doesn't help (from that article: "If you are happy to build the framework project before generating docs and all the problematic paths have the form ModuleName/PublicHeader.h then have clang resolve those includes to the built framework by passing -F "):

clang -c -x objective-c -isysroot $(xcrun --show-sdk-path) \
  -I $(pwd) Source/Ably.h \
  -F Carthage/Build \
  -fmodules

So, at this point I kinda ran out of ideas. Let me know if the last version of jazzy.sh works for you @lawrence-forooghian (it works for me locally and on CI without errors).

@lawrence-forooghian
Copy link
Collaborator

Hey @maratal - I haven't read your above comment in detail, but unfortunately on commit 3f7a94d I'm still getting the exact same error as before on my machine.

@github-actions github-actions bot temporarily deployed to staging/pull/1428/jazzydoc June 30, 2022 17:33 Inactive
@maratal maratal merged commit d75272a into main Jun 30, 2022
@maratal maratal deleted the jazzydoc branch June 30, 2022 21:31
maratal pushed a commit that referenced this pull request Jul 19, 2023
Feature spec: remove ChannelDetails.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants